]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/events.qh
Add a function to control weapon sound paths with hooks
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / events.qh
index 01cdd168f797e454d6af7398b470627cc46adda1..0f93f2ebfaa2f94037cfec79a0128abd0f0fab06 100644 (file)
@@ -56,13 +56,33 @@ entity frag_target;
 int frag_deathtype;
 MUTATOR_HOOKABLE(PlayerDies, EV_PlayerDies);
 
-/** called when a player dies to e.g. remove stuff he was carrying. */
+/** called when a player dies to e.g. remove stuff he was carrying */
 #define EV_PlayHitsound(i, o) \
     /**/ i(entity, frag_victim) \
     /**/
 entity frag_victim;
 MUTATOR_HOOKABLE(PlayHitsound, EV_PlayHitsound);
 
+/** called when a weapon sound is about to be played, allows custom paths etc. */
+#define EV_WeaponSound(i, o) \
+    /**/ i(string, weapon_sound) \
+    /**/ i(string, weapon_sound_output) \
+    /**/ o(string, weapon_sound_output) \
+    /**/
+string weapon_sound;
+string weapon_sound_output;
+MUTATOR_HOOKABLE(WeaponSound, EV_WeaponSound);
+
+/** called when a weapon model is about to be set, allows custom paths etc. */
+#define EV_WeaponModel(i, o) \
+    /**/ i(string, weapon_model) \
+    /**/ i(string, weapon_model_output) \
+    /**/ o(string, weapon_model_output) \
+    /**/
+string weapon_model;
+string weapon_model_output;
+MUTATOR_HOOKABLE(WeaponModel, EV_WeaponModel);
+
 /** called when a player presses the jump key */
 #define EV_PlayerJump(i, o) \
     /**/ i(float, player_multijump) \