summaryrefslogtreecommitdiff
path: root/src/game-server/command.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-29 08:50:56 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-29 08:50:56 +0000
commitb82bf7df7053a78d51706a5a017d61f564e4677e (patch)
tree398480b7b784abc1637a3f8e6f99d881b6bf613c /src/game-server/command.cpp
parentd9ae86e09977082791d5b24e304eabc5456ab4cf (diff)
downloadmanaserv-b82bf7df7053a78d51706a5a017d61f564e4677e.tar.gz
manaserv-b82bf7df7053a78d51706a5a017d61f564e4677e.tar.bz2
manaserv-b82bf7df7053a78d51706a5a017d61f564e4677e.tar.xz
manaserv-b82bf7df7053a78d51706a5a017d61f564e4677e.zip
Implemented "goto" and "recall" remote commands.
Diffstat (limited to 'src/game-server/command.cpp')
-rw-r--r--src/game-server/command.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/game-server/command.cpp b/src/game-server/command.cpp
index 94207439..342a14fd 100644
--- a/src/game-server/command.cpp
+++ b/src/game-server/command.cpp
@@ -205,6 +205,22 @@ static void spawn(Character *from, MonsterClass *specy, int nb)
}
}
+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);
+}
+
+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);
+}
+
/**
* List of remote commands.
*/
@@ -215,6 +231,8 @@ static Command const commands[] =
handle("drop", AL_GM, drop),
handle("money", AL_GM, money),
handle("spawn", AL_GM, spawn),
+ handle("goto", AL_GM, goto_),
+ handle("recall", AL_GM, recall),
};
/**