summaryrefslogtreecommitdiffstats
path: root/src/scripting/lua.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripting/lua.cpp')
-rw-r--r--src/scripting/lua.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp
index bdbb311..1c32c4f 100644
--- a/src/scripting/lua.cpp
+++ b/src/scripting/lua.cpp
@@ -1970,6 +1970,18 @@ static int is_walkable(lua_State *s)
return 1;
}
+static int map_get_pvp(lua_State *s)
+{
+ MapComposite *m = getScript(s)->getMap();
+ if (!m)
+ {
+ raiseScriptError(s, "map_get_pvp called outside a map.");
+ return 0;
+ }
+ lua_pushinteger(s, m->getPvP());
+ return 1;
+}
+
static int item_class_on(lua_State *s)
{
ItemClass *itemClass = LuaItemClass::check(s, 1);
@@ -2320,6 +2332,7 @@ LuaScript::LuaScript():
{ "get_map_id", &get_map_id },
{ "get_map_property", &get_map_property },
{ "is_walkable", &is_walkable },
+ { "map_get_pvp", &map_get_pvp },
{ "item_drop", &item_drop },
{ "item_get_name", &item_get_name },
{ "npc_ask_integer", &npc_ask_integer },