diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-08-29 08:50:56 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-08-29 08:50:56 +0000 |
commit | b82bf7df7053a78d51706a5a017d61f564e4677e (patch) | |
tree | 398480b7b784abc1637a3f8e6f99d881b6bf613c | |
parent | d9ae86e09977082791d5b24e304eabc5456ab4cf (diff) | |
download | manaserv-b82bf7df7053a78d51706a5a017d61f564e4677e.tar.gz manaserv-b82bf7df7053a78d51706a5a017d61f564e4677e.tar.bz2 manaserv-b82bf7df7053a78d51706a5a017d61f564e4677e.tar.xz manaserv-b82bf7df7053a78d51706a5a017d61f564e4677e.zip |
Implemented "goto" and "recall" remote commands.
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/game-server/command.cpp | 18 |
2 files changed, 20 insertions, 0 deletions
@@ -5,6 +5,8 @@ * src/game-server/command.cpp, src/game-server/gamehandler.cpp, src/game-server/gamehandler.hpp: Completed handler for admin commands, so that they can also touch local players. + * src/game-server/comand.cpp: Implemented "goto" and "recall" remote + commands. 2007-08-28 Guillaume Melquiond <guillaume.melquiond@gmail.com> 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), }; /** |