- Timestamp:
- May 25, 2013, 2:18:05 AM (11 years ago)
- Branches:
- master
- Children:
- e487381
- Parents:
- 2df63d6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
client/Client/main.cpp
r2df63d6 r626e5b0 228 228 else if(ev.type == ALLEGRO_EVENT_DISPLAY_CLOSE) { 229 229 doexit = true; 230 231 // perform a check to see if it's time to send an update to the server232 // need to store num ticks since the lst update for this233 // also check how often each update actually happens and how much it deviates from 60 times per second234 230 } 235 231 else if(ev.type == ALLEGRO_EVENT_KEY_DOWN) { … … 239 235 case ALLEGRO_KEY_ESCAPE: 240 236 doexit = true; 237 break; 238 case ALLEGRO_KEY_D: // drop the current item 239 if (state == STATE_LOGIN) { 240 map<unsigned int, Player>::iterator it; 241 Player* p = NULL; 242 for(it = mapPlayers.begin(); it != mapPlayers.end(); it++) 243 { 244 &it->second; 245 if (it->second.id == curPlayerId) 246 p = &it->second; 247 } 248 249 if (p != NULL) { 250 int flagType = WorldMap::OBJECT_NONE; 251 252 if (p->hasBlueFlag) 253 flagType = WorldMap::OBJECT_BLUE_FLAG; 254 else if (p->hasRedFlag) 255 flagType = WorldMap::OBJECT_RED_FLAG; 256 257 if (flagType != WorldMap::OBJECT_NONE) { 258 msgTo.type = MSG_TYPE_DROP_FLAG; 259 memcpy(msgTo.buffer, &curPlayerId, 4); 260 sendMessage(&msgTo, sock, &server); 261 } 262 } 263 } 241 264 break; 242 265 }
Note:
See TracChangeset
for help on using the changeset viewer.