Fix for Spell(int) not working in lua...

This commit is contained in:
KimLS
2013-07-03 15:20:42 -07:00
parent bccbc0f064
commit 8b8742b242
2 changed files with 10 additions and 1 deletions
+9 -1
View File
@@ -6,6 +6,14 @@
#include "../common/spdat.h"
#include "lua_spell.h"
Lua_Spell::Lua_Spell(int id) {
if(IsValidSpell(id)) {
SetLuaPtrData(&spells[id]);
} else {
SetLuaPtrData(nullptr);
}
}
int Lua_Spell::GetID() {
Lua_Safe_Call_Int();
return self->id;
@@ -416,10 +424,10 @@ int Lua_Spell::GetDamageShieldType() {
return self->DamageShieldType;
}
luabind::scope lua_register_spell() {
return luabind::class_<Lua_Spell>("Spell")
.def(luabind::constructor<>())
.def(luabind::constructor<int>())
.property("null", &Lua_Spell::Null)
.property("valid", &Lua_Spell::Valid)
.def("ID", &Lua_Spell::GetID)