From da13bb9cdead46e4774f3469de233dda4a7ba4a9 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 13 Jul 2016 17:53:56 +1000 Subject: [PATCH] Add a hook to customize entities post-update --- qcsrc/client/main.qc | 1 + qcsrc/client/mutators/events.qh | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 53cf24b53..7c39500c0 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -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; diff --git a/qcsrc/client/mutators/events.qh b/qcsrc/client/mutators/events.qh index 2c55bed1b..b72f7abe1 100644 --- a/qcsrc/client/mutators/events.qh +++ b/qcsrc/client/mutators/events.qh @@ -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); -- 2.39.2