summaryrefslogtreecommitdiffstats
path: root/src/game-server/command.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-09-23 11:35:06 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-09-23 11:35:06 +0000
commit203ed8e40105c17d300b12ee461327cb4416acf2 (patch)
treecdbc670b1724500e696da4dc787f094c8f512283 /src/game-server/command.cpp
parent6667a394a60e85f8bc34eb88c83350f4c28e9d34 (diff)
downloadmanaserv-203ed8e40105c17d300b12ee461327cb4416acf2.tar.gz
manaserv-203ed8e40105c17d300b12ee461327cb4416acf2.tar.xz
manaserv-203ed8e40105c17d300b12ee461327cb4416acf2.zip
Changed delayed events to an explicit interface.
Diffstat (limited to 'src/game-server/command.cpp')
-rw-r--r--src/game-server/command.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/game-server/command.cpp b/src/game-server/command.cpp
index 43bfe70..55ef4d1 100644
--- a/src/game-server/command.cpp
+++ b/src/game-server/command.cpp
@@ -179,8 +179,7 @@ static Command handle(char const *name, int level,
static void warp(Character *, Character *q, MapComposite *m, int x, int y)
{
- DelayedEvent e = { EVENT_WARP, x, y, m };
- GameState::enqueueEvent(q, e);
+ GameState::warp(q, m, x, y);
}
static void item(Character *, Character *q, ItemClass *it, int nb)
@@ -198,8 +197,7 @@ static void drop(Character *from, ItemClass *it, int nb)
Item *item = new Item(it, nb);
item->setMap(from->getMap());
item->setPosition(from->getPosition());
- DelayedEvent e = { EVENT_INSERT };
- GameState::enqueueEvent(item, e);
+ GameState::insert(item);
}
static void spawn(Character *from, MonsterClass *specy, int nb)
@@ -213,8 +211,7 @@ static void spawn(Character *from, MonsterClass *specy, int nb)
monster->setMap(map);
monster->setPosition(pos);
monster->clearDestination();
- DelayedEvent e = { EVENT_INSERT };
- GameState::enqueueEvent(monster, e);
+ GameState::insert(monster);
}
}
@@ -222,16 +219,14 @@ static void goto_(Character *from, Character *ch)
{
MapComposite *m = ch->getMap();
Point const &pos = ch->getPosition();
- DelayedEvent e = { EVENT_WARP, pos.x, pos.y, m };
- GameState::enqueueEvent(from, e);
+ GameState::warp(from, m, pos.x, pos.y);
}
static void recall(Character *from, Character *ch)
{
MapComposite *m = from->getMap();
Point const &pos = from->getPosition();
- DelayedEvent e = { EVENT_WARP, pos.x, pos.y, m };
- GameState::enqueueEvent(ch, e);
+ GameState::warp(ch, m, pos.x, pos.y);
}
static void reload(Character *, std::string const &db)