summaryrefslogtreecommitdiff
path: root/src/game-server/testing.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-01-05 09:47:12 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-01-05 09:47:12 +0000
commit7465e9bf8fe03961c02b360002439c1072090bf0 (patch)
tree9e25884ea13a29e370625ddf51c7eedb6326931b /src/game-server/testing.cpp
parent59e483ca6d2ec680f438787b4b3213534380c871 (diff)
downloadmanaserv-7465e9bf8fe03961c02b360002439c1072090bf0.tar.gz
manaserv-7465e9bf8fe03961c02b360002439c1072090bf0.tar.bz2
manaserv-7465e9bf8fe03961c02b360002439c1072090bf0.tar.xz
manaserv-7465e9bf8fe03961c02b360002439c1072090bf0.zip
Implemented item dropping.
Diffstat (limited to 'src/game-server/testing.cpp')
-rw-r--r--src/game-server/testing.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/game-server/testing.cpp b/src/game-server/testing.cpp
index 2565f3ec..61244974 100644
--- a/src/game-server/testing.cpp
+++ b/src/game-server/testing.cpp
@@ -14,6 +14,17 @@ static WarpAction warpA(3, 44 * 32 + 16, 80 * 32 + 16);
static Rectangle rectB = { 42 * 32, 88 * 32, 5 * 32, 32 };
static WarpAction warpB(1, 58 * 32 + 16, 17 * 32 + 16);
+static void dropItem(int map, int x, int y, int type)
+{
+ ItemClass *ic = itemManager->getItem(type);
+ assert(ic);
+ Item *i = new Item(ic, 1);
+ i->setMapId(map);
+ Point pos = { x, y };
+ i->setPosition(pos);
+ gameState->insert(i);
+}
+
void testingMap(int id)
{
switch (id)
@@ -30,13 +41,8 @@ void testingMap(int id)
being->setPosition(pos);
gameState->insert(being);
}
- ItemClass *ic = itemManager->getItem(508);
- assert(ic);
- Item *i = new Item(ic);
- i->setMapId(1);
- Point pos = { 58 * 32 + 16, 20 * 32 + 16 };
- i->setPosition(pos);
- gameState->insert(i);
+ dropItem(1, 58 * 32 + 16, 20 * 32 + 16, 508);
+ dropItem(1, 58 * 32 + 16, 21 * 32 + 16, 524);
} break;
case 3: