From: Mario Date: Sun, 30 Aug 2015 11:41:33 +0000 (+1000) Subject: Move a keepaway specific modifier into the keepaway mutator file X-Git-Tag: xonotic-v0.8.2~1963 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=716ff3ef08bec1385bfa04c0470ce7c332cb01e7;p=xonotic%2Fxonotic-data.pk3dir.git Move a keepaway specific modifier into the keepaway mutator file --- diff --git a/qcsrc/common/physics.qc b/qcsrc/common/physics.qc index 33aaeb58b..b53696b98 100644 --- a/qcsrc/common/physics.qc +++ b/qcsrc/common/physics.qc @@ -976,15 +976,6 @@ void SpecialCommand() #endif } -float PM_check_keepaway(void) -{ -#ifdef SVQC - return (self.ballcarried && g_keepaway) ? autocvar_g_keepaway_ballcarrier_highspeed : 1; -#else - return 1; -#endif -} - void PM_check_race_movetime(void) { #ifdef SVQC @@ -1675,7 +1666,6 @@ void PM_Main() WarpZone_PlayerPhysics_FixVAngle(); #endif float maxspeed_mod = 1; - maxspeed_mod *= PM_check_keepaway(); maxspeed_mod *= PHYS_HIGHSPEED; #ifdef SVQC diff --git a/qcsrc/server/mutators/gamemode_keepaway.qc b/qcsrc/server/mutators/gamemode_keepaway.qc index 2416425e8..96765796a 100644 --- a/qcsrc/server/mutators/gamemode_keepaway.qc +++ b/qcsrc/server/mutators/gamemode_keepaway.qc @@ -356,6 +356,16 @@ MUTATOR_HOOKFUNCTION(ka_PlayerPowerups) return 0; } +MUTATOR_HOOKFUNCTION(ka_PlayerPhysics) +{ + if(self.ballcarried) + { + self.stat_sv_airspeedlimit_nonqw *= autocvar_g_keepaway_ballcarrier_highspeed; + self.stat_sv_maxspeed *= autocvar_g_keepaway_ballcarrier_highspeed; + } + return false; +} + MUTATOR_HOOKFUNCTION(ka_BotShouldAttack) { // if neither player has ball then don't attack unless the ball is on the ground @@ -438,6 +448,7 @@ MUTATOR_DEFINITION(gamemode_keepaway) 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_HOOK(PlayerPhysics, ka_PlayerPhysics, CBC_ORDER_ANY); MUTATOR_HOOK(BotShouldAttack, ka_BotShouldAttack, CBC_ORDER_ANY); MUTATOR_HOOK(HavocBot_ChooseRole, ka_BotRoles, CBC_ORDER_ANY);