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

index 6ffeed9d8d42540d31432645cbce1d1db1f2c163..1de9d38178d05f0a023edc333df43755059d95d1 100644 (file)
@@ -892,13 +892,14 @@ bool Game::processAction(const String &an, Player* playerA, Player* playerB,  bo
                // requestor is local player and can see another player 
                 if (!current->dead && (predictionHandler->HandshakePosition(playerA, current) == 1))
                 {
+                    cout "trying handshake\n";  
                     msgBoard->setCaption("You shaked hands with Player " + StringConverter::toString(current->id));
                     gettimeofday(&msgTime, NULL);
                     localPlayer->HandshakesDone++;
                     localPlayer->HandshakesDoneAck++;
                     current->HandshakesReceived++;
                     current->HandshakesReceivedAck++;
-                    registerScore(playerA, playerB, HANDSHAKE);
+                    registerScore(localPlayer, current, HANDSHAKE);
                     localPlayer->playAnimation("handshake");
                     current->playAnimation("handshake");
 
@@ -1036,7 +1037,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, current, RPS);
+                    registerScore(localPlayer, current, RPS);
 
                      
                     Vector3 moveCamera = cameraPos;
@@ -1117,7 +1118,7 @@ bool Game::processAction(const String &an, Player* playerA, Player* playerB,  bo
                    
                     msgBoard->setCaption("You punched Player " + StringConverter::toString(current->id));
                     gettimeofday(&msgTime, NULL); 
-                    registerScore(playerA, current, PUNCH);
+                    registerScore(localPlayer, current, PUNCH);
                     
                     cameraYaw = Degree(-30);
                     cameraPosNew = cameraPos;   
@@ -1192,7 +1193,7 @@ bool Game::processAction(const String &an, Player* playerA, Player* playerB,  bo
                         current->playAnimation("nod");     
                         msgBoard->setCaption("You waved at Player " + StringConverter::toString(current->id));
                         gettimeofday(&msgTime, NULL); 
-                        registerScore(playerA, current, WAVE);
+                        registerScore(localPlayer, current, WAVE);
                         playerA->WavesDone++;
                         current->WavesReceived++;