]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add hooks to tag index
authorMario <zacjardine@y7mail.com>
Wed, 26 Aug 2015 01:38:05 +0000 (11:38 +1000)
committerMario <zacjardine@y7mail.com>
Wed, 26 Aug 2015 01:38:05 +0000 (11:38 +1000)
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/mutators/events.qh

index 91f3bfb4c6410f6b163e38eba85b882635bd6cfa..227341ae3d4936458a81d1369e89e1fa8e92d492 100644 (file)
@@ -12,6 +12,8 @@
 #include "../common/teams.qh"
 #include "../common/triggers/trigger/viewloc.qh"
 
+#include "mutators/events.qh"
+
 #include "../csqcmodellib/cl_model.qh"
 #include "../csqcmodellib/cl_player.qh"
 #include "../csqcmodellib/interpolate.qh"
@@ -407,6 +409,8 @@ void CSQCModel_AutoTagIndex_Apply(void)
        if(self.viewloc.entnum != self.tag_networkviewloc)
                self.viewloc = findfloat(world, entnum, self.tag_networkviewloc);
 
+       MUTATOR_CALLHOOK(TagIndex_Update, self);
+
        if(self.tag_networkentity)
        {
                // we are ATTACHED!
@@ -464,6 +468,8 @@ void CSQCModel_AutoTagIndex_Apply(void)
                                        if(!self.tag_index)
                                                self.tag_index = gettagindex(self.tag_entity, "tag_shot");
                                }
+
+                               MUTATOR_CALLHOOK(TagIndex_Apply, self);
                        }
                        else
                        {
index 16ae922f220ba774fb3dfdc892eb411de9b89da1..363af87a0ef216cf00b33c619b26bb665a5c2dc5 100644 (file)
@@ -76,4 +76,16 @@ MUTATOR_HOOKABLE(EditProjectile, EV_EditProjectile);
 /* Called when projectiles are precached */
 MUTATOR_HOOKABLE(PrecacheProjectiles, EV_NO_ARGS);
 
+/** Called when updating the attached tags index */
+#define EV_TagIndex_Update(i, o) \
+    /** entity id */ i(entity, self) \
+    /**/
+MUTATOR_HOOKABLE(TagIndex_Update, EV_TagIndex_Update);
+
+/** Called when setting the attached tags */
+#define EV_TagIndex_Apply(i, o) \
+    /** entity id */ i(entity, self) \
+    /**/
+MUTATOR_HOOKABLE(TagIndex_Apply, EV_TagIndex_Apply);
+
 #endif