Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.76 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.                     for (unsigned int j = 0; j < 64; j++)
  12.                     {
  13.                         m_players[j].isDead = 1;
  14.                     }
  15.  
  16.                     // if we start, reset waypoint counter
  17.                     if(m_currentGameState == GS_WARMUP_COUNTDOWN && newgs == GS_PLAYING)
  18.                     {
  19.                         m_pathRound++;
  20.                         for (unsigned int j = 0; j < 64; j++)
  21.                         {                          
  22.                             m_players[j].waypoints = 0;
  23.                         }
  24.                     }
  25.  
  26.                     GetGamestateCallback()->Execute(m_currentGameState, newgs, m_currentRound, tmp.c_str());
  27.                     m_currentGameState = newgs;
  28.                 }              
  29.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement