]> git.uio.no Git - private-olgabo.git/commitdiff
sc
authorolgabo <olgabo@ifi.uio.no>
Fri, 26 Oct 2012 17:48:14 +0000 (19:48 +0200)
committerolgabo <olgabo@ifi.uio.no>
Fri, 26 Oct 2012 17:48:14 +0000 (19:48 +0200)
projects/dumbclient/Game.cpp

index 570b5fff05611b71d2c86c5f5741635d671fd7b0..b68e81fb0641eb9ee823e5f005337a496b62197a 100644 (file)
@@ -992,9 +992,9 @@ bool Game::processAction(const String &an, Player* playerA, Player* playerB,  bo
         else
         {
             Player *current;
-            for (current = localPlayer; current != NULL; current = current->next)
+            for (current = localPlayer->next; current != NULL; current = current->next)
             {               
-                if (current != playerA && !current->dead && predictionHandler->RockPaperScissorsPosition(playerA, current) == 1)
+                if (!current->dead && predictionHandler->RockPaperScissorsPosition(playerA, current) == 1)
                 {
                     srand((unsigned)time(0));
                     int rps = rand() % 3;
@@ -1033,7 +1033,7 @@ bool Game::processAction(const String &an, Player* playerA, Player* playerB,  bo
                     current->RPSReceivedAck++;
                     msgBoard->setCaption("You challenged Player " + StringConverter::toString(current->id) + " to play 'rock-paper-scissors' ");
                     gettimeofday(&msgTime, NULL);
-                    registerScore(playerA, playerB, RPS);
+                    registerScore(playerA, current, RPS);
 
                      
                     Vector3 moveCamera = cameraPos;