Changeset 0678d60 in network-game for common/Game.cpp


Ignore:
Timestamp:
Jan 22, 2014, 1:31:27 AM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
06fc7f7
Parents:
204edcf
Message:

All server warnings have been fixed and the WorldMap class has a new method to create flags (and, in the future, other objects) based on structures present on the map

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/Game.cpp

    r204edcf r0678d60  
    162162   vector<WorldMap::Object>* vctObjects = this->worldMap->getObjects();
    163163   vector<WorldMap::Object>::iterator it;
    164    int playerId = -1;
     164   int itemId = -1;
    165165
    166166   for (it = vctObjects->begin(); it != vctObjects->end(); it++) {
     
    170170               if (p->team == 1) {
    171171                  p->hasBlueFlag = true;
    172                   playerId = it->id;
     172                  itemId = it->id;
    173173               }
    174174               break;
     
    176176               if (p->team == 0) {
    177177                  p->hasRedFlag = true;
    178                   playerId = it->id;
     178                  itemId = it->id;
    179179               }
    180180               break;
    181          }
    182 
    183          if (playerId > -1) {
     181            case WorldMap::OBJECT_NONE:
     182               break;
     183         }
     184
     185         if (itemId > -1) {
    184186            vctObjects->erase(it);
    185             return playerId;
    186          }
    187       }
    188    }
    189 
    190    return playerId;
     187            return itemId;
     188         }
     189      }
     190   }
     191
     192   return itemId;
    191193}
    192194
     
    214216
    215217bool Game::handleGameEvents() {
    216    NETWORK_MSG serverMsg;
    217218   map<unsigned int, Player*>::iterator it;
    218219   bool gameFinished = false;
     
    325326            }
    326327
     328            break;
     329         }
     330         default:
     331         {
    327332            break;
    328333         }
Note: See TracChangeset for help on using the changeset viewer.