From: terencehill Date: Wed, 15 Jul 2015 18:26:52 +0000 (+0200) Subject: Keepaway: synchronize game start with ball respawn and make sure that while the count... X-Git-Tag: xonotic-v0.8.1~36^2^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=84e15d7180ff09f237574d296f5f5eab2fb158e5;p=xonotic%2Fxonotic-data.pk3dir.git Keepaway: synchronize game start with ball respawn and make sure that while the countdown is going on nobody can accidentally take it --- diff --git a/qcsrc/server/mutators/gamemode_keepaway.qc b/qcsrc/server/mutators/gamemode_keepaway.qc index 1a91658a6..ed69612d1 100644 --- a/qcsrc/server/mutators/gamemode_keepaway.qc +++ b/qcsrc/server/mutators/gamemode_keepaway.qc @@ -25,6 +25,7 @@ void ka_EventLog(string mode, entity actor) // use an alias for easy changing an GameLogEcho(strcat(":ka:", mode, ((actor != world) ? (strcat(":", ftos(actor.playerid))) : ""))); } +void ka_TouchEvent(); void ka_RespawnBall() // runs whenever the ball needs to be relocated { if(gameover) { return; } @@ -42,6 +43,7 @@ void ka_RespawnBall() // runs whenever the ball needs to be relocated self.velocity = '0 0 200'; self.angles = '0 0 0'; self.effects = autocvar_g_keepawayball_effects; + self.touch = ka_TouchEvent; self.think = ka_RespawnBall; self.nextthink = time + autocvar_g_keepawayball_respawntime; @@ -169,7 +171,14 @@ void ka_Reset() // used to clear the ballcarrier whenever the match switches fro if((self.owner) && (IS_PLAYER(self.owner))) ka_DropEvent(self.owner); - ka_RespawnBall(); + if(time < game_starttime) + { + self.think = ka_RespawnBall; + self.touch = func_null; + self.nextthink = game_starttime; + } + else + ka_RespawnBall(); }