]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/gamemode_keepaway.qc
Remove the priority system for centerprint messages in the server, we no longer need it
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_keepaway.qc
index 60c39d43410498bc752265a9d0d9e1f645da9ca2..4d67e1aa82b59df5e5bc26982e8d48a0d54d504a 100644 (file)
@@ -216,7 +216,7 @@ MUTATOR_HOOKFUNCTION(ka_Scoring)
                }
                else if(!frag_attacker.ballcarried)
                        if(autocvar_g_keepaway_noncarrier_warn)
-                               centerprint_atprio(frag_attacker, (CENTERPRIO_SPAM + 5), "Killing people while you don't have the ball gives no points!");
+                               centerprint(frag_attacker, "Killing people while you don't have the ball gives no points!");
 
                if(frag_attacker.ballcarried) // add to amount of kills while ballcarrier
                        PlayerScore_Add(frag_attacker, SP_SCORE, autocvar_g_keepaway_score_killac);
@@ -241,10 +241,17 @@ MUTATOR_HOOKFUNCTION(ka_PlayerPreThink)
        if(self.ballcarried)
                self.items |= IT_KEY1;
 
-       // drop the ball if the player presses the use button
-       if(self.BUTTON_USE)
-               if(self.ballcarried) { ka_DropEvent(self); } 
+       return 0;
+}
 
+MUTATOR_HOOKFUNCTION(ka_PlayerUseKey)
+{
+       if(MUTATOR_RETURNVALUE == 0)
+       if(self.ballcarried)
+       {
+               ka_DropEvent(self);
+               return 1;
+       }
        return 0;
 }
 
@@ -307,6 +314,7 @@ MUTATOR_DEFINITION(gamemode_keepaway)
        MUTATOR_HOOK(PlayerPreThink, ka_PlayerPreThink, CBC_ORDER_ANY);
        MUTATOR_HOOK(PlayerDamage_Calculate, ka_PlayerDamage, CBC_ORDER_ANY);
        MUTATOR_HOOK(PlayerPowerups, ka_PlayerPowerups, CBC_ORDER_ANY);
+       MUTATOR_HOOK(PlayerUseKey, ka_PlayerUseKey, CBC_ORDER_ANY);
 
        MUTATOR_ONADD
        {