]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator/gamemode_keepaway.qc
Propagate sound references
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator / gamemode_keepaway.qc
index 1e593d0eff0afdac49d2e5a5cbb28cc55bb6cfb5..28270b88525074edfb781efc9fb9448289aa4614 100644 (file)
@@ -1,3 +1,4 @@
+#include "gamemode_keepaway.qh"
 #ifndef GAMEMODE_KEEPAWAY_H
 #define GAMEMODE_KEEPAWAY_H
 
@@ -132,8 +133,8 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth
                ka_RespawnBall();
                return;
        }
-       if(other.deadflag != DEAD_NO) { return; }
-       if(other.frozen) { return; }
+       if(IS_DEAD(other)) { return; }
+       if(STAT(FROZEN, other)) { return; }
        if (!IS_PLAYER(other))
        {  // The ball just touched an object, most likely the world
                Send_Effect(EFFECT_BALL_SPARKS, self.origin, '0 0 0', 1);
@@ -263,7 +264,7 @@ void havocbot_goalrating_ball(float ratingscale, vector org)
 
 void havocbot_role_ka_carrier()
 {SELFPARAM();
-       if (self.deadflag != DEAD_NO)
+       if (IS_DEAD(self))
                return;
 
        if (time > self.bot_strategytime)
@@ -286,7 +287,7 @@ void havocbot_role_ka_carrier()
 
 void havocbot_role_ka_collector()
 {SELFPARAM();
-       if (self.deadflag != DEAD_NO)
+       if (IS_DEAD(self))
                return;
 
        if (time > self.bot_strategytime)
@@ -313,7 +314,7 @@ void havocbot_role_ka_collector()
 // ==============
 
 MUTATOR_HOOKFUNCTION(ka, PlayerDies)
-{SELFPARAM();
+{
        if((frag_attacker != frag_target) && (IS_PLAYER(frag_attacker)))
        {
                if(frag_target.ballcarried) { // add to amount of times killing carrier
@@ -329,7 +330,7 @@ MUTATOR_HOOKFUNCTION(ka, PlayerDies)
                        PlayerScore_Add(frag_attacker, SP_SCORE, autocvar_g_keepaway_score_killac);
        }
 
-       if(self.ballcarried) { ka_DropEvent(self); } // a player with the ball has died, drop it
+       if(frag_target.ballcarried) { ka_DropEvent(frag_target); } // a player with the ball has died, drop it
        return 0;
 }