From 1e6b7a30b7232dce7b8240441bed04912e06f666 Mon Sep 17 00:00:00 2001 From: Erik Schilling Date: Sat, 8 Oct 2011 11:19:44 +0200 Subject: Added script bindings for reading map objects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit map_get_objects([string filter]): returns all object of the current map optionally filtered by type. map_get_object_property(handle object, string key): returns the value of the property of the object. map_get_object_bounds(handle object): returns x, y, width, height of an object. map_get_object_name(handle object): returns name of an object. map_get_object_type(handle object): returns type of an object. Mantis-issue: 397 Reviewed-by: Thorbjørn Lindeijer --- src/scripting/luautil.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/scripting/luautil.cpp') diff --git a/src/scripting/luautil.cpp b/src/scripting/luautil.cpp index b7680c6..a752142 100644 --- a/src/scripting/luautil.cpp +++ b/src/scripting/luautil.cpp @@ -116,3 +116,8 @@ void push(lua_State *s, double val) { lua_pushnumber(s, val); } + +void push(lua_State *s, MapObject *val) +{ + lua_pushlightuserdata(s, val); +} -- cgit