Changeset 0678d60 in network-game for common/Game.cpp
- Timestamp:
- Jan 22, 2014, 1:31:27 AM (11 years ago)
- Branches:
- master
- Children:
- 06fc7f7
- Parents:
- 204edcf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
common/Game.cpp
r204edcf r0678d60 162 162 vector<WorldMap::Object>* vctObjects = this->worldMap->getObjects(); 163 163 vector<WorldMap::Object>::iterator it; 164 int playerId = -1;164 int itemId = -1; 165 165 166 166 for (it = vctObjects->begin(); it != vctObjects->end(); it++) { … … 170 170 if (p->team == 1) { 171 171 p->hasBlueFlag = true; 172 playerId = it->id;172 itemId = it->id; 173 173 } 174 174 break; … … 176 176 if (p->team == 0) { 177 177 p->hasRedFlag = true; 178 playerId = it->id;178 itemId = it->id; 179 179 } 180 180 break; 181 } 182 183 if (playerId > -1) { 181 case WorldMap::OBJECT_NONE: 182 break; 183 } 184 185 if (itemId > -1) { 184 186 vctObjects->erase(it); 185 return playerId;186 } 187 } 188 } 189 190 return playerId;187 return itemId; 188 } 189 } 190 } 191 192 return itemId; 191 193 } 192 194 … … 214 216 215 217 bool Game::handleGameEvents() { 216 NETWORK_MSG serverMsg;217 218 map<unsigned int, Player*>::iterator it; 218 219 bool gameFinished = false; … … 325 326 } 326 327 328 break; 329 } 330 default: 331 { 327 332 break; 328 333 }
Note:
See TracChangeset
for help on using the changeset viewer.