summaryrefslogtreecommitdiffstats
path: root/src/scripting/luautil.cpp
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2013-04-03 14:32:57 +0200
committerErik Schilling <ablu.erikschilling@googlemail.com>2013-04-03 21:52:03 +0200
commit4b57962ee4c10e48956c2888199605bebdb17b8f (patch)
tree261b141a1ad61a64e93a7b99a8c68debfb48d055 /src/scripting/luautil.cpp
parent4a8080dcf73dab2b6e62b8500fec3bb996bcbf17 (diff)
downloadmanaserv-4b57962ee4c10e48956c2888199605bebdb17b8f.tar.gz
manaserv-4b57962ee4c10e48956c2888199605bebdb17b8f.tar.xz
manaserv-4b57962ee4c10e48956c2888199605bebdb17b8f.zip
Moved the Monster class to a Component
Things done: - Allowed to create new Attributes outside of the protected scope of Being - Moved Monster to MonsterComponent - Some minor cleanup in the Attribute setting code of monsters
Diffstat (limited to 'src/scripting/luautil.cpp')
-rw-r--r--src/scripting/luautil.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/scripting/luautil.cpp b/src/scripting/luautil.cpp
index 24e9edf..d082cbe 100644
--- a/src/scripting/luautil.cpp
+++ b/src/scripting/luautil.cpp
@@ -158,14 +158,14 @@ ItemClass *getItemClass(lua_State *s, int p)
return itemClass;
}
-Monster *getMonster(lua_State *s, int p)
+Being *getMonster(lua_State *s, int p)
{
if (!lua_islightuserdata(s, p))
return 0;
Entity *t = static_cast<Entity *>(lua_touserdata(s, p));
if (t->getType() != OBJECT_MONSTER)
return 0;
- return static_cast<Monster *>(t);
+ return static_cast<Being*>(t);
}
MonsterClass *getMonsterClass(lua_State *s, int p)
@@ -220,9 +220,9 @@ ItemClass *checkItemClass(lua_State *s, int p)
return itemClass;
}
-Monster *checkMonster(lua_State *s, int p)
+Being *checkMonster(lua_State *s, int p)
{
- Monster *monster = getMonster(s, p);
+ Being *monster = getMonster(s, p);
luaL_argcheck(s, monster, p, "monster expected");
return monster;
}