]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a hook to customize entities post-update
authorMario <mario@smbclan.net>
Wed, 13 Jul 2016 07:53:56 +0000 (17:53 +1000)
committerMario <mario@smbclan.net>
Wed, 13 Jul 2016 07:53:56 +0000 (17:53 +1000)
qcsrc/client/main.qc
qcsrc/client/mutators/events.qh

index 53cf24b534b50f8001ece3b6b6a93eebc618e575..7c39500c00c9232746bd70d36a8f7200576a7493 100644 (file)
@@ -825,6 +825,7 @@ void CSQC_Ent_Update(entity this, bool isnew)
                if (autocvar_developer_csqcentities)
             LOG_INFOF("CSQC_Ent_Update(%d) at %f with this=%i {.entnum=%d, .enttype=%d} t=%s (%d)\n", isnew, savetime, this, this.entnum, this.enttype, this.classname, t);
                done = it.m_read(this, NULL, isnew);
+               MUTATOR_CALLHOOK(Ent_Update, this, isnew);
                break;
        });
        time = savetime;
index 2c55bed1b2d5f26f887ae80e1b96a772ad1f2af3..b72f7abe1a3bdcb8cef50d10333d6f997259299a 100644 (file)
@@ -135,3 +135,10 @@ MUTATOR_HOOKABLE(HUD_Command, EV_HUD_Command);
        /** team */                     i(float, MUTATOR_ARGV_3_float) \
        /**/
 MUTATOR_HOOKABLE(DrawGrapplingHook, EV_DrawGrapplingHook);
+
+/** Called when an entity is updated (either by SVQC networking or PVS) */
+#define EV_Ent_Update(i, o) \
+       /** entity id */                i(entity, MUTATOR_ARGV_0_entity) \
+       /** is new to client */ i(bool, MUTATOR_ARGV_1_bool) \
+       /**/
+MUTATOR_HOOKABLE(Ent_Update, EV_Ent_Update);