diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/entity.cc | 4 | ||||
-rw-r--r-- | src/core/gameserver.cc | 15 |
2 files changed, 15 insertions, 4 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc index 4f13efa..af100a9 100644 --- a/src/core/entity.cc +++ b/src/core/entity.cc @@ -512,7 +512,7 @@ void Entity::reset() if (!entity_body) { // create collision shape if (model()) { - entity_collision_shape = new btBoxShape(to_btVector3(model()->maxbbox())); + entity_collision_shape = new btBoxShape(to_btVector3(model()->box().max())); } else { entity_collision_shape = new btSphereShape(radius()); } @@ -938,7 +938,7 @@ void EntityControlable::reset() if (!entity_body) { // create collision shape if (model()) { - entity_collision_shape = new btBoxShape(to_btVector3(model()->maxbbox())); + entity_collision_shape = new btBoxShape(to_btVector3(model()->box().max())); } else { entity_collision_shape = new btSphereShape(radius()); } diff --git a/src/core/gameserver.cc b/src/core/gameserver.cc index f84e228..412c554 100644 --- a/src/core/gameserver.cc +++ b/src/core/gameserver.cc @@ -209,10 +209,13 @@ GameServer::~GameServer() delete server_network; server_network = 0; } - + if (server_module->interactive()) save_config(); + // clear game data + clear(); + if (server_module) { if (!Cvar::sv_dedicated->value()) player_disconnect(localplayer()); @@ -520,9 +523,17 @@ void GameServer::frame(unsigned long timestamp) math::Vector3f keepalive_minbox; // run a game frame on all dynamic and controlable entities - for (Zone::Content::iterator it = zone->content().begin(); it != zone->content().end(); it++) { + for (Zone::Content::iterator it = zone->content().begin(); it != zone->content().end(); it++) { Entity *entity = (*it); + + // FIXME + // if a controlable changes zone during the entity frame (like when using jumpgates) + // the zone content iterator will become invalid + // possible solutions + // 1) move the actual zone change into the entity_destroyed sequence (renamed entity.oldzone to newzone and track changes) + // 2) revert to using the entity iterator and add the keep_alive min- and maxbox to the zone class + if (entity->type() == Entity::Dynamic) { entity->frame(elapsed); |