]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/gamemode_ctf.qc
Merge branch 'master' into Mario/classname_checks
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_ctf.qc
index 8f0bc931efd540c587ea0f1ea5f3371fb04bdd0d..bc19d88ebb7bc1899ce203c1f6c462e3bc96c46c 100644 (file)
@@ -825,7 +825,7 @@ void ctf_FlagTouch()
                else
                        return; // do nothing
        }
-       else if(toucher.classname != "player") // The flag just touched an object, most likely the world
+       else if not(IS_PLAYER(toucher)) // The flag just touched an object, most likely the world
        {
                if(time > self.wait) // if we haven't in a while, play a sound/effect
                {
@@ -865,7 +865,7 @@ void ctf_FlagTouch()
                
                case FLAG_PASSING:
                {
-                       if((toucher.classname == "player") && (toucher.deadflag == DEAD_NO) && (toucher != self.pass_sender))
+                       if((IS_PLAYER(toucher)) && (toucher.deadflag == DEAD_NO) && (toucher != self.pass_sender))
                        {
                                if(IsDifferentTeam(toucher, self.pass_sender))
                                        ctf_Handle_Return(self, toucher);
@@ -928,7 +928,7 @@ void ctf_RespawnFlag(entity flag)
 void ctf_Reset()
 {
        if(self.owner)
-               if(self.owner.classname == "player")
+               if(IS_PLAYER(self.owner))
                        ctf_Handle_Throw(self.owner, world, DROP_RESET);
                        
        ctf_RespawnFlag(self);
@@ -1780,7 +1780,7 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerDamage) // for changing damage and force values t
 
 MUTATOR_HOOKFUNCTION(ctf_PlayerDies)
 {
-       if((frag_attacker != frag_target) && (frag_attacker.classname == "player") && (frag_target.flagcarried))
+       if((frag_attacker != frag_target) && (IS_PLAYER(frag_target)) && (frag_target.flagcarried))
        {
                PlayerTeamScore_AddScore(frag_attacker, autocvar_g_ctf_score_kill);
                PlayerScore_Add(frag_attacker, SP_CTF_FCKILLS, 1);
@@ -1840,7 +1840,7 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerUseKey)
                        
                        while(head) // find the closest acceptable target to pass to
                        {
-                               if(head.classname == "player" && head.deadflag == DEAD_NO)
+                               if(IS_PLAYER(head) && head.deadflag == DEAD_NO)
                                if(head != player && !IsDifferentTeam(head, player))
                                if(!head.speedrunning && !head.vehicle)
                                {
@@ -1852,7 +1852,7 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerUseKey)
                                        {
                                                if(autocvar_g_ctf_pass_request && !player.flagcarried && head.flagcarried) 
                                                { 
-                                                       if(clienttype(head) == CLIENTTYPE_BOT)
+                                                       if(IS_BOT_CLIENT(head))
                                                        {
                                                                Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_PASS_REQUESTING, head.netname);
                                                                ctf_Handle_Throw(head, player, DROP_PASS);