diff options
author | Stijn Buys <ingar@osirion.org> | 2008-04-05 10:52:39 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-04-05 10:52:39 +0000 |
commit | 25d2c764443723eb7a3dd5f8bf0b76586c1ff10b (patch) | |
tree | b9cc681a3ff20900b32ce287505d018e0a7ae35f /src/core/netconnection.cc | |
parent | 49e268d1b4244948e49a11612501a743e311fbaf (diff) |
Makefile.am updates, math::Axis, improved VertexArray, r_arraysize
Diffstat (limited to 'src/core/netconnection.cc')
-rw-r--r-- | src/core/netconnection.cc | 60 |
1 files changed, 31 insertions, 29 deletions
diff --git a/src/core/netconnection.cc b/src/core/netconnection.cc index 9fd4e33..fd590c0 100644 --- a/src/core/netconnection.cc +++ b/src/core/netconnection.cc @@ -304,48 +304,50 @@ void NetConnection::parse_incoming_message(const std::string & message) } else if (command == "die") { unsigned int id; - msgstream >> id; - - Entity *e = Entity::find(id); - //con_debug << "Received die entity id " << id << "\n"; - - if (localcontrol() == e) - localplayer()->player_control = 0; - if (e) - Entity::remove(id); - + if (msgstream >> id) { + //con_debug << "Received die entity id " << id << std::endl; + Entity *e = Entity::find(id); + if (localcontrol() == e) + localplayer()->player_control = 0; + if (e) + Entity::remove(id); + } } else if (command == "ent") { unsigned int type; - msgstream >> type; - - //con_debug << "Received create entity type " << type << "\n"; - switch (type) - { - case Entity::Default: - new Entity(msgstream); - break; - case Entity::Dynamic: - new EntityDynamic(msgstream); - break; - case Entity::Controlable: - new EntityControlable(msgstream); - break; - default: - break; + if (msgstream >> type) { + //con_debug << "Received create entity type " << type << std::endl; + switch (type) + { + case Entity::Default: + new Entity(msgstream); + break; + case Entity::Dynamic: + new EntityDynamic(msgstream); + break; + case Entity::Controlable: + new EntityControlable(msgstream); + break; + case Entity::Globe: + new EntityGlobe(msgstream); + break; + default: + con_warn << "Create for unknown entity type " << type << std::endl; + break; + } } - } else if (command == "sup") { unsigned int id; if (msgstream >> id) { + //con_debug << "Received update entity id " << id << std::endl; Entity *entity = Entity::find(id); if (!entity) { - con_warn << "Update for unknown entity " << id << "\n"; + con_warn << "Update for unknown entity " << id << std::endl; } else entity->recieve_server_update(msgstream); } } else if (command == "pif") { - + //con_debug << "Received update player info" << std::endl; connection()->localplayer()->recieve_server_update(msgstream); } |