summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilipp Sehmisch <crush@themanaworld.org>2009-02-10 14:45:26 +0100
committerPhilipp Sehmisch <crush@themanaworld.org>2009-02-10 14:58:59 +0100
commit08b15ca37fd6cb658a873b36115f2c78be29e272 (patch)
tree8c26fb9015e0a04659e6213ac7097eb853026d90 /src
parentef5d6d3c0c8c35aabc0ee208572d95b7d1838147 (diff)
downloadmanaserv-08b15ca37fd6cb658a873b36115f2c78be29e272.tar.gz
manaserv-08b15ca37fd6cb658a873b36115f2c78be29e272.tar.bz2
manaserv-08b15ca37fd6cb658a873b36115f2c78be29e272.tar.xz
manaserv-08b15ca37fd6cb658a873b36115f2c78be29e272.zip
Removed testing.cpp because all of its functionality can now be covered by LUA scripts
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am1
-rw-r--r--src/game-server/mapmanager.cpp3
-rw-r--r--src/game-server/testing.cpp36
-rw-r--r--src/scripting/lua.cpp8
4 files changed, 8 insertions, 40 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index f8923824..62cc50fa 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -138,7 +138,6 @@ tmwserv_game_SOURCES = \
game-server/spawnarea.cpp \
game-server/state.hpp \
game-server/state.cpp \
- game-server/testing.cpp \
game-server/thing.hpp \
game-server/thing.cpp \
game-server/trade.hpp \
diff --git a/src/game-server/mapmanager.cpp b/src/game-server/mapmanager.cpp
index 68372ed9..2cc37de3 100644
--- a/src/game-server/mapmanager.cpp
+++ b/src/game-server/mapmanager.cpp
@@ -132,9 +132,6 @@ void MapManager::raiseActive(int mapId)
MapReader::readMap(file, composite);
LOG_INFO("Activated map \"" << file << "\" (id " << mapId << ")");
- // Add some testing stuff
- extern void testingMap(MapComposite *);
- testingMap(composite);
}
diff --git a/src/game-server/testing.cpp b/src/game-server/testing.cpp
deleted file mode 100644
index 4828df40..00000000
--- a/src/game-server/testing.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/* This file is for testing purpose only. It hardcodes some events related
- to the game. It should be removed once all the related managers have been
- implemented. There are no headers for this file on purpose. */
-
-#include <cassert>
-
-#include "game-server/gamehandler.hpp"
-#include "game-server/item.hpp"
-#include "game-server/itemmanager.hpp"
-#include "game-server/mapcomposite.hpp"
-#include "game-server/state.hpp"
-#include "scripting/script.hpp"
-
-static void dropItem(MapComposite *map, int x, int y, int type)
-{
- ItemClass *ic = ItemManager::getItem(type);
- assert(ic);
- Item *i = new Item(ic, 1);
- i->setMap(map);
- Point pos(x, y);
- i->setPosition(pos);
- GameState::insertSafe(i);
-}
-
-void testingMap(MapComposite *map)
-{
- switch (map->getID())
- {
- case 1:
- {
- // Drop some items.
- dropItem(map, 58 * 32 + 16, 20 * 32 + 16, 508);
- dropItem(map, 58 * 32 + 16, 21 * 32 + 16, 524);
- } break;
- }
-}
diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp
index 010179b4..1cfb8766 100644
--- a/src/scripting/lua.cpp
+++ b/src/scripting/lua.cpp
@@ -982,6 +982,14 @@ static int get_map_id(lua_State *s)
*/
static int item_drop(lua_State *s)
{
+ if (!lua_isnumber(s, 1) ||
+ !lua_isnumber(s, 2) ||
+ !lua_isnumber(s, 3))
+ {
+ raiseScriptError(s, "trigger_create called with incorrect parameters.");
+ return 0;
+ }
+
int x = lua_tointeger(s, 1);
int y = lua_tointeger(s, 2);
int type = lua_tointeger(s, 3);