]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
AI inherits player score when a player leaves
authorMattia Basaglia <mattia.basaglia@gmail.com>
Fri, 6 Mar 2015 07:54:32 +0000 (08:54 +0100)
committerMattia Basaglia <mattia.basaglia@gmail.com>
Fri, 6 Mar 2015 07:54:32 +0000 (08:54 +0100)
qcsrc/common/minigames/minigame/pong.qc

index 7e785d17c9f742e3b2e4e39029aaf56770da5ef0..7cb37de3c713c02643e9aee0c079788cea2b723c 100644 (file)
@@ -363,13 +363,15 @@ int pong_server_event(entity minigame, string event, ...)
                {
                        entity player = ...(0,entity);
                        entity paddle;
+                       entity ai;
                        int i;
                        for ( i = 0; i < PONG_MAX_PLAYERS; i++ )
                        {
                                paddle = minigame.pong_paddles[i];
                                if ( paddle != world && paddle.realowner == player )
                                {
-                                       pong_ai_spawn(paddle);
+                                       ai = pong_ai_spawn(paddle);
+                                       ai.pong_score = player.minigame_players.pong_score;
                                        break;
                                }