Added id to spells so i can export them to lua correctly. Also made the lua_classes less messy by having them all derive from Lua_Ptr instead of reimplementing functionality

This commit is contained in:
KimLS
2013-05-16 23:24:47 -07:00
parent b10de6f4e7
commit 3ddc61420b
14 changed files with 121 additions and 56 deletions
+6 -5
View File
@@ -10,13 +10,14 @@ class Lua_Mob : public Lua_Entity
{
typedef Mob NativeType;
public:
Lua_Mob() { d_ = nullptr; }
Lua_Mob(NativeType *d) { d_ = d; }
Lua_Mob() { }
Lua_Mob(Mob *d) { SetLuaPtrData(d); }
virtual ~Lua_Mob() { }
operator NativeType* () {
if(d_) {
return reinterpret_cast<NativeType*>(d_);
operator Mob*() {
void *d = GetLuaPtrData();
if(d) {
return reinterpret_cast<Mob*>(d);
}
return nullptr;