]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/events.qh
Fix domination ready-restart disabling player movement
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / events.qh
index 4795aab28dcb5dcf7fca777e3758c4e61670f5ee..00d2716e4b6e287b5bdb2ffd9d2f0555fb203460 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SERVER_MUTATORS_EVENTS_H
 #define SERVER_MUTATORS_EVENTS_H
 
-#include "../../common/mutators/base.qh"
+#include <common/mutators/base.qh>
 
 // register all possible hooks here
 
@@ -73,16 +73,6 @@ 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 an item model is about to be set, allows custom paths etc. */
 #define EV_ItemModel(i, o) \
     /**/ i(string, item_model) \
@@ -93,17 +83,6 @@ string item_model;
 string item_model_output;
 MUTATOR_HOOKABLE(ItemModel, EV_ItemModel);
 
-/** called when a player presses the jump key */
-#define EV_PlayerJump(i, o) \
-    /**/ i(float, player_multijump) \
-    /**/ i(float, player_jumpheight) \
-    /**/ o(float, player_multijump) \
-    /**/ o(float, player_jumpheight) \
-    /**/
-float player_multijump;
-float player_jumpheight;
-MUTATOR_HOOKABLE(PlayerJump, EV_PlayerJump);
-
 /** called when someone was fragged by "self", and is expected to change frag_score to adjust scoring for the kill */
 #define EV_GiveFragsForKill(i, o) \
     /**/ i(entity, __self) \
@@ -219,12 +198,6 @@ MUTATOR_HOOKABLE(PlayerPreThink, EV_NO_ARGS);
 /** TODO change this into a general PlayerPostThink hook? */
 MUTATOR_HOOKABLE(GetPressedKeys, EV_NO_ARGS);
 
-/**
- * called before any player physics, may adjust variables for movement,
- * is run AFTER bot code and idle checking
- */
-MUTATOR_HOOKABLE(PlayerPhysics, EV_NO_ARGS);
-
 /** is meant to call GetCvars_handle*(get_cvars_s, get_cvars_f, cvarfield, "cvarname") for cvars this mutator needs from the client */
 #define EV_GetCvars(i, o) \
     /**/ i(float, get_cvars_f) \
@@ -242,10 +215,14 @@ MUTATOR_HOOKABLE(GetCvars, EV_NO_ARGS); // NOTE: Can't use EV_GetCvars because o
 MUTATOR_HOOKABLE(EditProjectile, EV_EditProjectile);
 
 /** called when a monster spawns */
-MUTATOR_HOOKABLE(MonsterSpawn, EV_NO_ARGS);
+#define EV_MonsterSpawn(i, o) \
+    /**/ i(entity, __self) \
+    /**/
+MUTATOR_HOOKABLE(MonsterSpawn, EV_MonsterSpawn);
 
 /** called when a monster dies */
 #define EV_MonsterDies(i, o) \
+    /**/ i(entity, frag_target) \
     /**/ i(entity, frag_attacker) \
     /**/
 MUTATOR_HOOKABLE(MonsterDies, EV_MonsterDies);
@@ -276,6 +253,7 @@ MUTATOR_HOOKABLE(MonsterDropItem, EV_MonsterDropItem);
  * returning true makes the monster stop
  */
 #define EV_MonsterMove(i, o) \
+    /**/ i(entity, __self) \
     /**/ i(float, monster_speed_run) \
     /**/ o(float, monster_speed_run) \
     /**/ i(float, monster_speed_walk) \
@@ -291,7 +269,10 @@ MUTATOR_HOOKABLE(MonsterMove, EV_MonsterMove);
 MUTATOR_HOOKABLE(MonsterFindTarget, EV_NO_ARGS);
 
 /** called to change a random monster to a miniboss */
-MUTATOR_HOOKABLE(MonsterCheckBossFlag, EV_NO_ARGS);
+#define EV_MonsterCheckBossFlag(i, o) \
+    /**/ i(entity, __self) \
+    /**/
+MUTATOR_HOOKABLE(MonsterCheckBossFlag, EV_MonsterCheckBossFlag);
 
 /**
  * called when a player tries to spawn a monster
@@ -701,6 +682,7 @@ MUTATOR_HOOKABLE(FixClientCvars, EV_FixClientCvars);
 #define EV_SpectateSet(i, o) \
     /**/ i(entity, __self) \
     /**/ i(entity, spec_player) \
+    /**/ o(entity, spec_player) \
     /**/
 entity spec_player;
 MUTATOR_HOOKABLE(SpectateSet, EV_SpectateSet);
@@ -708,12 +690,14 @@ MUTATOR_HOOKABLE(SpectateSet, EV_SpectateSet);
 #define EV_SpectateNext(i, o) \
     /**/ i(entity, __self) \
     /**/ i(entity, spec_player) \
+    /**/ o(entity, spec_player) \
     /**/
 MUTATOR_HOOKABLE(SpectateNext, EV_SpectateNext);
 
 #define EV_SpectatePrev(i, o) \
     /**/ i(entity, __self) \
     /**/ i(entity, spec_player) \
+    /**/ o(entity, spec_player) \
     /**/ i(entity, spec_first) \
     /**/
 entity spec_first;
@@ -852,4 +836,14 @@ MUTATOR_HOOKABLE(PrepareExplosionByDamage, EV_PrepareExplosionByDamage);
 string monster_model;
 string monster_model_output;
 MUTATOR_HOOKABLE(MonsterModel, EV_MonsterModel);
+
+/**/
+#define EV_Player_ChangeTeam(i, o) \
+    /**/ i(entity, __self) \
+    /**/ i(float, pct_curteam) \
+    /**/ i(float, pct_newteam) \
+    /**/
+float pct_curteam;
+float pct_newteam;
+MUTATOR_HOOKABLE(Player_ChangeTeam, EV_Player_ChangeTeam);
 #endif