mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 05:21:29 +00:00
Fix for Spell(int) not working in lua...
This commit is contained in:
parent
bccbc0f064
commit
8b8742b242
@ -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)
|
||||
|
||||
@ -16,6 +16,7 @@ class Lua_Spell : public Lua_Ptr<const SPDat_Spell_Struct>
|
||||
{
|
||||
typedef const SPDat_Spell_Struct NativeType;
|
||||
public:
|
||||
Lua_Spell(int id);
|
||||
Lua_Spell() : Lua_Ptr(nullptr) { }
|
||||
Lua_Spell(const SPDat_Spell_Struct *d) : Lua_Ptr(d) { }
|
||||
virtual ~Lua_Spell() { }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user