if (mutator_returnvalue) {
// mutator prevents resetting teams+score
} else {
+ int oldteam = this.team;
this.team = -1; // move this as it is needed to log the player spectating in eventlog
+ MUTATOR_CALLHOOK(Player_ChangedTeam, this, oldteam, this.team); // Lyberta: added hook
this.frags = FRAGS_SPECTATOR;
PlayerScore_Clear(this); // clear scores when needed
}
sv_notice_join(this);
// update physics stats (players can spawn before physics runs)
+ STAT(MOVEVARS_HIGHSPEED, this) = autocvar_g_movement_highspeed;
+ MUTATOR_CALLHOOK(PlayerPhysics_UpdateStats, this); // do it BEFORE the function so we can modify highspeed!
Physics_UpdateStats(this, PHYS_HIGHSPEED(this));
IL_EACH(g_initforplayer, it.init_for_player, {
/** called when an item is about to respawn */
#define EV_Item_RespawnCountdown(i, o) \
- /** item name */ i(string, MUTATOR_ARGV_0_string) \
- /**/ o(string, MUTATOR_ARGV_0_string) \
- /** item colour */ i(vector, MUTATOR_ARGV_1_vector) \
- /**/ o(vector, MUTATOR_ARGV_1_vector) \
+ /** item */ i(entity, MUTATOR_ARGV_0_entity) \
/**/
MUTATOR_HOOKABLE(Item_RespawnCountdown, EV_Item_RespawnCountdown);
/**/
MUTATOR_HOOKABLE(MonsterModel, EV_MonsterModel);
-/**/
+/**
+ * Called before player changes their team. Return true to block team change.
+ */
#define EV_Player_ChangeTeam(i, o) \
/** player */ i(entity, MUTATOR_ARGV_0_entity) \
/** current team */ i(float, MUTATOR_ARGV_1_float) \
/**/
MUTATOR_HOOKABLE(Player_ChangeTeam, EV_Player_ChangeTeam);
+/**
+ * Called after player has changed their team.
+ */
+#define EV_Player_ChangedTeam(i, o) \
+ /** player */ i(entity, MUTATOR_ARGV_0_entity) \
+ /** old team */ i(float, MUTATOR_ARGV_1_float) \
+ /** current team */ i(float, MUTATOR_ARGV_2_float) \
+ /**/
+MUTATOR_HOOKABLE(Player_ChangedTeam, EV_Player_ChangedTeam);
+
/**/
#define EV_URI_GetCallback(i, o) \
/** id */ i(float, MUTATOR_ARGV_0_float) \
/** player */ i(entity, MUTATOR_ARGV_0_entity) \
/**/
MUTATOR_HOOKABLE(HideTeamNagger, EV_HideTeamNagger);
+
+ /** return true to show a waypoint while the item is spawning */
+ #define EV_Item_ScheduleRespawn(i, o) \
+ /** item */ i(entity, MUTATOR_ARGV_0_entity) \
+ /** respawn time */ i(float, MUTATOR_ARGV_1_float) \
+ /**/
+ MUTATOR_HOOKABLE(Item_ScheduleRespawn, EV_Item_ScheduleRespawn);
+
+ /** called before physics stats are set on a player, allows limited early customization */
+ #define EV_PlayerPhysics_UpdateStats(i, o) \
+ /** player */ i(entity, MUTATOR_ARGV_0_entity) \
+ /**/
+ MUTATOR_HOOKABLE(PlayerPhysics_UpdateStats, EV_PlayerPhysics_UpdateStats);
+
+ /** return true to use your own aim target (or none at all) */
+ #define EV_HavocBot_Aim(i, o) \
+ /** bot */ i(entity, MUTATOR_ARGV_0_entity) \
+ /**/
+ MUTATOR_HOOKABLE(HavocBot_Aim, EV_HavocBot_Aim);