]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a hook to team change function, will come in handy soon
authorMario <mario@smbclan.net>
Sun, 29 Nov 2015 15:37:59 +0000 (01:37 +1000)
committerMario <mario@smbclan.net>
Sun, 29 Nov 2015 15:37:59 +0000 (01:37 +1000)
qcsrc/server/mutators/events.qh
qcsrc/server/teamplay.qc

index be95bd1a49a3d5e35660ffe1e1b14ab96a086ecb..ff9a775cf9fd8e0f4faaeb2efaac33f877541a3a 100644 (file)
@@ -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
index b0f44da6b7e51d5104d3d01b1571b3c149bc874c..0662aab68ece77f479b001efc99f4a11cee5c488 100644 (file)
@@ -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)