- Timestamp:
- Dec 20, 2013, 2:09:42 AM (11 years ago)
- Branches:
- master
- Children:
- ce2bb87
- Parents:
- 402cf86
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
client/Client/main.cpp
r402cf86 r6c9bcdd 356 356 break; 357 357 case ALLEGRO_KEY_S: // pickup an item next to you 358 if (state == STATE_GAME ) {358 if (state == STATE_GAME || state == STATE_NEW_GAME) { 359 359 msgTo.type = MSG_TYPE_PICKUP_FLAG; 360 360 memcpy(msgTo.buffer, &curPlayerId, 4); … … 363 363 break; 364 364 case ALLEGRO_KEY_D: // drop the current item 365 if (state == STATE_GAME) { 366 // find the current player in the player list 367 map<unsigned int, Player*>::iterator it; 365 if (state == STATE_GAME || state == STATE_NEW_GAME) { 368 366 Player* p = NULL; 369 for(it = mapPlayers.begin(); it != mapPlayers.end(); it++) 370 { 371 if (it->second->id == curPlayerId) 372 p = it->second; 373 } 367 try { 368 p = mapPlayers.at(curPlayerId); 369 } catch (const out_of_range& ex) {} 374 370 375 371 if (p != NULL) {
Note:
See TracChangeset
for help on using the changeset viewer.