summaryrefslogtreecommitdiffstats
path: root/src/game-server/state.cpp
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2012-03-17 21:56:00 +0100
committerErik Schilling <ablu.erikschilling@googlemail.com>2012-03-17 23:40:12 +0100
commita6c3eed2b9a91e9768ec6ce137879cac13703dea (patch)
treeb85bd802a6169dfd2e99f99d3150004d7e90e6a0 /src/game-server/state.cpp
parentf98ba725442348584810c089111501a07ac59905 (diff)
downloadmanaserv-a6c3eed2b9a91e9768ec6ce137879cac13703dea.tar.gz
manaserv-a6c3eed2b9a91e9768ec6ce137879cac13703dea.tar.xz
manaserv-a6c3eed2b9a91e9768ec6ce137879cac13703dea.zip
Added map update function, moved schedules there to keep map context
Reviewed-by: bjorn.
Diffstat (limited to 'src/game-server/state.cpp')
-rw-r--r--src/game-server/state.cpp30
1 files changed, 1 insertions, 29 deletions
diff --git a/src/game-server/state.cpp b/src/game-server/state.cpp
index 34ede68..0e7bea2 100644
--- a/src/game-server/state.cpp
+++ b/src/game-server/state.cpp
@@ -70,34 +70,6 @@ static DelayedEvents delayedEvents;
*/
static std::map< std::string, std::string > mScriptVariables;
-
-/**
- * Updates object states on the map.
- */
-static void updateMap(MapComposite *map)
-{
- // Update object status
- const std::vector< Thing * > &things = map->getEverything();
- for (std::vector< Thing * >::const_iterator it = things.begin(),
- it_end = things.end(); it != it_end; ++it)
- {
- (*it)->update();
- }
-
- // Perform actions
- for (BeingIterator it(map->getWholeMapIterator()); it; ++it)
- {
- (*it)->perform();
- }
-
- // Move objects around and update zones.
- for (BeingIterator it(map->getWholeMapIterator()); it; ++it)
- {
- (*it)->move();
- }
- map->update();
-}
-
/**
* Sets message fields describing character look.
*/
@@ -456,7 +428,7 @@ void GameState::update(int worldTime)
if (!map->isActive())
continue;
- updateMap(map);
+ map->update();
for (CharacterIterator p(map->getWholeMapIterator()); p; ++p)
{