diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2011-08-23 22:34:15 +0800 |
---|---|---|
committer | Yohann Ferreira <yohann.ferreira@orange.fr> | 2011-08-25 17:41:43 +0800 |
commit | f3a1137c1df39b760417870544debf3baf1cd572 (patch) | |
tree | ec97ccb3f23f0bb0406e3659328e946002cb5a08 | |
parent | 10fe47ad83a36b4371c1dd8df85544a8189080d7 (diff) | |
download | manaserv-f3a1137c1df39b760417870544debf3baf1cd572.tar.gz manaserv-f3a1137c1df39b760417870544debf3baf1cd572.tar.bz2 manaserv-f3a1137c1df39b760417870544debf3baf1cd572.tar.xz manaserv-f3a1137c1df39b760417870544debf3baf1cd572.zip |
Allowed map names in chr_warp function.
Resolves: Mana-Mantis #293.
Reviewed-by: Bertram.
-rw-r--r-- | src/scripting/lua.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp index 7cc09d56..546f4a66 100644 --- a/src/scripting/lua.cpp +++ b/src/scripting/lua.cpp @@ -299,7 +299,7 @@ static int chr_warp(lua_State *s) Character *q = getCharacter(s, 1); bool b = lua_isnil(s, 2); - if (!q || !(b || lua_isnumber(s, 2))) + if (!q || !(b || lua_isnumber(s, 2) || lua_isstring(s, 2))) { raiseScriptError(s, "chr_warp called with incorrect parameters."); return 0; @@ -312,10 +312,14 @@ static int chr_warp(lua_State *s) Script *t = static_cast<Script *>(lua_touserdata(s, -1)); m = t->getMap(); } - else + else if (lua_isnumber(s, 2)) { m = MapManager::getMap(lua_tointeger(s, 2)); } + else + { + m = MapManager::getMap(lua_tostring(s, 2)); + } if (!m) { raiseScriptError(s, "chr_warp called with a non-existing map."); |