+ float movement = 0;
+ float movement_speed = autocvar_sv_minigames_pong_paddlespeed * think_speed;
+ float halflen = self.pong_length/2;
+
+ if ( !self.realowner )
+ {
+ entity ball = world;
+ while ( ( ball = findentity(ball,owner,self.owner) ) )
+ if ( ball.classname == "pong_ball" )
+ {
+ if ( self.team <= 2 )
+ {
+ if (ball.origin_y < self.origin_y-halflen/3)
+ movement = -movement_speed;
+ else if (ball.origin_y > self.origin_y+halflen/3)
+ movement = movement_speed;
+ }
+ else
+ {
+ if (ball.origin_x < self.origin_x-halflen/3)
+ movement = -movement_speed;
+ else if (ball.origin_x > self.origin_x+halflen/3)
+ movement = movement_speed;
+ }
+ break; // TODO support multiple balls?
+ }
+ }
+ else if ( self.realowner.minigame_players.pong_keys )
+ {
+ if ( self.realowner.minigame_players.pong_keys == PONG_KEY_INCREASE )
+ movement = movement_speed;
+ else if ( self.realowner.minigame_players.pong_keys == PONG_KEY_DECREASE )
+ movement = -movement_speed;
+ }
+
+
+ if ( movement )