diff options
Diffstat (limited to 'src/core/gameserver.cc')
-rw-r--r-- | src/core/gameserver.cc | 15 |
1 files changed, 13 insertions, 2 deletions
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); |