]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/mutators/events.qh
Add hooks to tag index
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / mutators / events.qh
index 8f317c8e8a6f042476a887fbeb1869bc2b7841a7..363af87a0ef216cf00b33c619b26bb665a5c2dc5 100644 (file)
@@ -45,8 +45,47 @@ MUTATOR_HOOKABLE(UpdateCrosshair, EV_NO_ARGS);
  * NOTE: return true if you handled the command, return false to continue handling
  */
 #define EV_CSQC_Parse_TempEntity(i, o) \
-    /** entity id */ i(int, mutator_argv_int_0) \
+    /** mutator id */ i(int, mutator_argv_int_0) \
     /**/
 MUTATOR_HOOKABLE(CSQC_Parse_TempEntity, EV_CSQC_Parse_TempEntity);
 
+/**
+ * Called when a shared entity is updated
+ * NOTE: hooks MUST start with `if (MUTATOR_RETURNVALUE) return false;`
+ * NOTE: hooks MUST start with `if (!ReadMutatorEquals(mutator_argv_int_0, name_of_mutator)) return false;`
+ * NOTE: return true if you handled the command, return false to continue handling
+ */
+#define EV_CSQC_Ent_Update(i, o) \
+    /** mutator id */ i(int, mutator_argv_int_0) \
+    /** bIsNewEntity */ i(bool, mutator_argv_bool_0) \
+    /**/
+MUTATOR_HOOKABLE(CSQC_Ent_Update, EV_CSQC_Ent_Update);
+
+/** Called when a projectile is linked with CSQC */
+#define EV_Ent_Projectile(i, o) \
+    /** entity id */ i(entity, self) \
+    /**/
+MUTATOR_HOOKABLE(Ent_Projectile, EV_Ent_Projectile);
+
+/** Called when a projectile's properties are being modified */
+#define EV_EditProjectile(i, o) \
+    /** entity id */ i(entity, self) \
+    /**/
+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