summaryrefslogtreecommitdiff
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
parentd9ae86e09977082791d5b24e304eabc5456ab4cf (diff)
downloadmanaserv-b82bf7df7053a78d51706a5a017d61f564e4677e.tar.gz
manaserv-b82bf7df7053a78d51706a5a017d61f564e4677e.tar.bz2
manaserv-b82bf7df7053a78d51706a5a017d61f564e4677e.tar.xz
manaserv-b82bf7df7053a78d51706a5a017d61f564e4677e.zip
Implemented "goto" and "recall" remote commands.
-rw-r--r--ChangeLog2
-rw-r--r--src/game-server/command.cpp18
2 files changed, 20 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 99495d0d..a65cd27c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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),
};
/**