Changeset 66c4ec4 in network-game for server


Ignore:
Timestamp:
Jun 19, 2013, 11:46:30 PM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
5a5f131
Parents:
c76134b
Message:

Restore the player's health and move him next to his base when he respawns

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/server.cpp

    rc76134b r66c4ec4  
    176176
    177177                  it->second.pos = spawnPos.toFloat();
     178                  it->second.target = spawnPos;
     179                  it->second.health = it->second.maxHealth;
    178180
    179181                  serverMsg.type = MSG_TYPE_PLAYER;
     
    209211         bool broadcastMove = false;
    210212         for (it = mapPlayers.begin(); it != mapPlayers.end(); it++) {
    211             cout << "Starting new for loop iteration" << endl;
    212213            oldPos = it->second.pos;
    213214            if (it->second.move(gameMap)) {
     
    440441         }
    441442
    442          cout << "Done with the for loop" << endl;
    443 
    444443         // move all projectiles
    445          cout << "Moving projectiles" << endl;
    446444         map<unsigned int, Projectile>::iterator itProj;
    447445         for (itProj = mapProjectiles.begin(); itProj != mapProjectiles.end(); itProj++) {
     
    481479         }
    482480      }
    483       cout << "Done moving projectiles" << endl;
    484481
    485482      n = receiveMessage(&clientMsg, sock, &from);
     
    904901      p->health = 0;
    905902   if (p->health == 0) {
     903      cout << "Player died" << endl;
    906904      p->isDead = true;
    907905      p->timeDied = getCurrentMillis();
Note: See TracChangeset for help on using the changeset viewer.