[INT64] Fix int64 for OOC Regen and GetHP(), GetMaxHP(), GetItemHPBonuses() in Perl/Lua. (#2218)

* [INT64] Fix int64 for OOC Regen and GetHP(), GetMaxHP(), GetItemHPBonuses() in Perl/Lua.
- These all had int64 values and were overflowing, returning garbage data.

* Update npc.cpp
This commit is contained in:
Kinglykrab
2022-05-29 14:33:30 -04:00
committed by GitHub
parent bcf7ccefcd
commit 8f3ac74196
5 changed files with 22 additions and 22 deletions
+6 -6
View File
@@ -482,17 +482,17 @@ bool Lua_Mob::IsWarriorClass() {
return self->IsWarriorClass();
}
int Lua_Mob::GetHP() {
int64 Lua_Mob::GetHP() {
Lua_Safe_Call_Int();
return self->GetHP();
}
int Lua_Mob::GetMaxHP() {
int64 Lua_Mob::GetMaxHP() {
Lua_Safe_Call_Int();
return self->GetMaxHP();
}
int Lua_Mob::GetItemHPBonuses() {
int64 Lua_Mob::GetItemHPBonuses() {
Lua_Safe_Call_Int();
return self->GetItemHPBonuses();
}
@@ -1356,9 +1356,9 @@ bool Lua_Mob::DivineAura() {
return self->DivineAura();
}
void Lua_Mob::SetOOCRegen(int regen) {
void Lua_Mob::SetOOCRegen(int64 new_ooc_regen) {
Lua_Safe_Call_Void();
self->SetOOCRegen(regen);
self->SetOOCRegen(new_ooc_regen);
}
const char* Lua_Mob::GetEntityVariable(const char *name) {
@@ -2860,7 +2860,7 @@ luabind::scope lua_register_mob() {
.def("SetLevel", (void(Lua_Mob::*)(int))&Lua_Mob::SetLevel)
.def("SetLevel", (void(Lua_Mob::*)(int,bool))&Lua_Mob::SetLevel)
.def("SetMana", &Lua_Mob::SetMana)
.def("SetOOCRegen", (void(Lua_Mob::*)(int))&Lua_Mob::SetOOCRegen)
.def("SetOOCRegen", (void(Lua_Mob::*)(int64))&Lua_Mob::SetOOCRegen)
.def("SetPet", &Lua_Mob::SetPet)
.def("SetPetOrder", (void(Lua_Mob::*)(int))&Lua_Mob::SetPetOrder)
.def("SetPseudoRoot", (void(Lua_Mob::*)(bool))&Lua_Mob::SetPseudoRoot)