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_Client : public Lua_Mob
{
typedef Client NativeType;
public:
Lua_Client() { d_ = nullptr; }
Lua_Client(NativeType *d) { d_ = d; }
Lua_Client() { }
Lua_Client(Client *d) { SetLuaPtrData(d); }
virtual ~Lua_Client() { }
operator NativeType* () {
if(d_) {
return reinterpret_cast<NativeType*>(d_);
operator Client*() {
void *d = GetLuaPtrData();
if(d) {
return reinterpret_cast<Client*>(d);
}
return nullptr;