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
+28
View File
@@ -0,0 +1,28 @@
#ifndef EQEMU_LUA_ITEM_H
#define EQEMU_LUA_ITEM_H
#ifdef LUA_EQEMU
#include "lua_ptr.h"
struct SPDat_Spell_Struct;
class Lua_Spell : public Lua_Ptr
{
typedef SPDat_Spell_Struct NativeType;
public:
Lua_Spell() { }
Lua_Spell(SPDat_Spell_Struct *d) : Lua_Ptr(d) { }
virtual ~Lua_Spell() { }
operator SPDat_Spell_Struct*() {
void *d = GetLuaPtrData();
if(d) {
return reinterpret_cast<SPDat_Spell_Struct*>(d);
}
return nullptr;
}
};
#endif
#endif