Changeset ea17281 in network-game for common/Game.cpp


Ignore:
Timestamp:
Jul 4, 2014, 8:09:47 PM (10 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
e98426d
Parents:
a0ce8a3
Message:

Game.addPlayer takes a boolean to indicate wheter it runs on the server. If it's not, the team isn't randomly generated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/Game.cpp

    ra0ce8a3 rea17281  
    4343}
    4444
    45 bool Game::addPlayer(Player* p) {
     45bool Game::addPlayer(Player* p, bool serverSide) {
    4646   if (players.find(p->getId()) == players.end()) {
    4747      players[p->getId()] = p;
     
    5858      p->hasRedFlag = false;
    5959
    60       // choose a random team (either 0 or 1)
    61       p->team = rand() % 2;
     60      if (serverSide) {
     61         // choose a random team (either 0 or 1)
     62         p->team = rand() % 2;
     63      }
    6264
    6365      p->currentGame = this;
Note: See TracChangeset for help on using the changeset viewer.