diff options
author | Stijn Buys <ingar@osirion.org> | 2010-11-08 14:34:44 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2010-11-08 14:34:44 +0000 |
commit | b7dc0938eb7d59f928bbcf2a3a4877a6f60940e5 (patch) | |
tree | 5b4b4353f2012fced4180072e0b0def8ba8d22db /src/core/gameserver.cc | |
parent | b685a594ae43aa30173912c9fb1177d507ec5a08 (diff) |
moved clear() from game::Game~ to core::GameServer~ (solves FIXME),
unified bounding box code into math::BoundingBox3f class
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); |