Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.70 KB | None | 0 0
  1. for (unsigned int i = 0; i < tokens.size() - 1; i++)
  2.         {
  3.             string key = tokens[i];
  4.             string val = tokens[i+1];
  5.            
  6.             if(!strcmp(key.c_str(), "gamestate"))
  7.             {
  8.                 gamestate_e newgs = ( gamestate_e ) atoi( val.c_str() );
  9.                 if(newgs != m_currentGameState)
  10.                 {
  11.                     m_players[i].isDead = 1;
  12.  
  13.                     // if we start, reset waypoint counter
  14.                     if(m_currentGameState == GS_WARMUP_COUNTDOWN && newgs == GS_PLAYING)
  15.                     {
  16.                         m_pathRound++;
  17.                         for (unsigned int i = 0; i < 64; i++)
  18.                         {                          
  19.                             m_players[i].waypoints = 0;
  20.                         }
  21.                     }
  22.  
  23.                     GetGamestateCallback()->Execute(m_currentGameState, newgs, m_currentRound, tmp.c_str());
  24.                     m_currentGameState = newgs;
  25.                 }              
  26.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement