From: Mattia Basaglia Date: Thu, 12 Feb 2015 09:18:05 +0000 (+0100) Subject: Complete pong goal logic with other teams X-Git-Tag: xonotic-v0.8.2~2038^2~25 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c2f4b5984b726ad4fac2555b28976465a8404ebf;p=xonotic%2Fxonotic-data.pk3dir.git Complete pong goal logic with other teams --- diff --git a/qcsrc/common/minigames/minigame/pong.qc b/qcsrc/common/minigames/minigame/pong.qc index a963f0262..c4df2ba33 100644 --- a/qcsrc/common/minigames/minigame/pong.qc +++ b/qcsrc/common/minigames/minigame/pong.qc @@ -100,15 +100,25 @@ void pong_ball_think() self.origin_x += self.velocity_x * think_speed; self.origin_y += self.velocity_y * think_speed; + + // TODO consider the ball's radius (and add cvar for that) if ( self.origin_y <= 0 ) { - self.origin_y = 0; - self.velocity_y *= -1; + if ( !pong_goal(self,3) ) + { + self.origin_y = 0; + self.velocity_y *= -1; + self.team = 3; + } } else if ( self.origin_y >= 1 ) { - self.origin_y = 1; - self.velocity_y *= -1; + if ( !pong_goal(self,4) ) + { + self.origin_y = 1; + self.velocity_y *= -1; + self.team = 4; + } } if ( self.origin_x <= 0 ) @@ -129,7 +139,6 @@ void pong_ball_think() self.team = 1; } } - // TODO team 3 4 goal check self.SendFlags |= MINIG_SF_UPDATE; }