summaryrefslogtreecommitdiffstats
path: root/src/scripting/luautil.h
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2013-04-14 11:15:35 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2013-04-14 11:15:35 +0200
commit3a132996f798dbf552ac858b06fa656b6790a501 (patch)
tree050396efcc609d5234414f15d52b6f4c123e6f80 /src/scripting/luautil.h
parentff7041ab8d0c176a7c9764656c21177944f52c31 (diff)
downloadmanaserv-3a132996f798dbf552ac858b06fa656b6790a501.tar.gz
manaserv-3a132996f798dbf552ac858b06fa656b6790a501.tar.xz
manaserv-3a132996f798dbf552ac858b06fa656b6790a501.zip
Use a full user data for Entity references
Only moved a single script function to a member for now, will do others in a separate commit.
Diffstat (limited to 'src/scripting/luautil.h')
-rw-r--r--src/scripting/luautil.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/scripting/luautil.h b/src/scripting/luautil.h
index 1bc0293..6d078e3 100644
--- a/src/scripting/luautil.h
+++ b/src/scripting/luautil.h
@@ -156,6 +156,7 @@ template <typename T> const char * LuaUserData<T>::mTypeName;
typedef LuaUserData<AttackInfo> LuaAttackInfo;
typedef LuaUserData<Damage> LuaDamage;
+typedef LuaUserData<Entity> LuaEntity;
typedef LuaUserData<ItemClass> LuaItemClass;
typedef LuaUserData<MapObject> LuaMapObject;
typedef LuaUserData<MonsterClass> LuaMonsterClass;
@@ -164,13 +165,10 @@ typedef LuaUserData<SpecialManager::SpecialInfo> LuaSpecialInfo;
Script * getScript(lua_State *s);
-Entity * getBeing(lua_State *s, int p);
-Entity * getCharacter(lua_State *s, int p);
ItemClass * getItemClass(lua_State *s, int p);
-Entity * getMonster(lua_State *s, int p);
MonsterClass * getMonsterClass(lua_State *s, int p);
-Entity * getNpc(lua_State *s, int p);
+Entity * checkActor(lua_State *s, int p);
Entity * checkBeing(lua_State *s, int p);
Entity * checkCharacter(lua_State *s, int p);
ItemClass * checkItemClass(lua_State *s, int p);
@@ -199,7 +197,7 @@ inline void push(lua_State *s, const std::string &val)
inline void push(lua_State *s, Entity *val)
{
- lua_pushlightuserdata(s, val);
+ LuaEntity::push(s, val);
}
inline void push(lua_State *s, double val)