]> 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 a23169c37346758fb1c7adbec38f8586f74d30f7..4d67e1aa82b59df5e5bc26982e8d48a0d54d504a 100644 (file)
@@ -172,7 +172,7 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los
        sound(other, CHAN_AUTO, "keepaway/dropped.wav", VOL_BASE, ATTN_NONE);   // ATTN_NONE (it's a sound intended to be heard anywhere) 
        
        // scoring
-       PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1);
+       // PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless.
        
        // waypoints
        WaypointSprite_Spawn("ka-ball", 0, 0, ball, '0 0 64', world, ball.team, ball, waypointsprite_attachedforcarrier, FALSE);
@@ -200,7 +200,7 @@ void ka_TimeScoring()
                if(autocvar_g_keepaway_score_timepoints)
                        PlayerScore_Add(self.owner, SP_SCORE, autocvar_g_keepaway_score_timepoints);
                        
-               PlayerScore_Add(self.owner, SP_KEEPAWAY_TIME, (autocvar_g_keepaway_score_timeinterval / 1)); // interval is divided by 1 so that time always shows "seconds"
+               PlayerScore_Add(self.owner, SP_KEEPAWAY_BCTIME, (autocvar_g_keepaway_score_timeinterval / 1)); // interval is divided by 1 so that time always shows "seconds"
                self.nextthink = time + autocvar_g_keepaway_score_timeinterval;
        }
 }
@@ -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
        {