From: Mario Date: Sun, 29 Nov 2015 15:37:59 +0000 (+1000) Subject: Add a hook to team change function, will come in handy soon X-Git-Tag: xonotic-v0.8.2~1604 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ca72730bfd00d5f872bf27931adc42e3d67ff2bb;p=xonotic%2Fxonotic-data.pk3dir.git Add a hook to team change function, will come in handy soon --- diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index be95bd1a4..ff9a775cf 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -838,4 +838,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 diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index b0f44da6b..0662aab68 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -651,6 +651,8 @@ void SV_ChangeTeam(float _color) if(!IS_CLIENT(self)) Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_CONNECTING, self.netname); + MUTATOR_CALLHOOK(Player_ChangeTeam, self, steam, dteam); + SetPlayerTeam(self, dteam, steam, !IS_CLIENT(self)); if(IS_PLAYER(self) && steam != dteam)