From 11369247b1578d187d296907eafa9204e597b5ec Mon Sep 17 00:00:00 2001 From: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com> Date: Sun, 29 May 2022 17:36:32 -0400 Subject: [PATCH] [INT64] Further int64 cleanup in Perl SetHP() and GetSpellHPBonuses() in Perl/Lua. (#2222) --- zone/lua_mob.cpp | 2 +- zone/lua_mob.h | 2 +- zone/mob.cpp | 4 ++-- zone/mob.h | 2 +- zone/perl_mob.cpp | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/zone/lua_mob.cpp b/zone/lua_mob.cpp index ee84e3337..e99e968ad 100644 --- a/zone/lua_mob.cpp +++ b/zone/lua_mob.cpp @@ -497,7 +497,7 @@ int64 Lua_Mob::GetItemHPBonuses() { return self->GetItemHPBonuses(); } -int Lua_Mob::GetSpellHPBonuses() { +int64 Lua_Mob::GetSpellHPBonuses() { Lua_Safe_Call_Int(); return self->GetSpellHPBonuses(); } diff --git a/zone/lua_mob.h b/zone/lua_mob.h index 8bcef6541..a390dc6ab 100644 --- a/zone/lua_mob.h +++ b/zone/lua_mob.h @@ -126,7 +126,7 @@ public: int64 GetHP(); int64 GetMaxHP(); int64 GetItemHPBonuses(); - int GetSpellHPBonuses(); + int64 GetSpellHPBonuses(); double GetWalkspeed(); double GetRunspeed(); int GetCasterLevel(int spell_id); diff --git a/zone/mob.cpp b/zone/mob.cpp index 07b00830a..189ae6c8e 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -981,8 +981,8 @@ int64 Mob::GetItemHPBonuses() { return item_hp; } -int32 Mob::GetSpellHPBonuses() { - int32 spell_hp = 0; +int64 Mob::GetSpellHPBonuses() { + int64 spell_hp = 0; spell_hp = spellbonuses.HP; spell_hp += spell_hp * spellbonuses.MaxHPChange / 10000; return spell_hp; diff --git a/zone/mob.h b/zone/mob.h index f3cf67c65..c1b0322ed 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -608,7 +608,7 @@ public: virtual int64 GetMaxEndurance() const { return 0; } virtual void SetEndurance(int32 newEnd) { return; } int64 GetItemHPBonuses(); - int32 GetSpellHPBonuses(); + int64 GetSpellHPBonuses(); virtual const int64& SetMana(int64 amount); inline float GetManaRatio() const { return max_mana == 0 ? 100 : ((static_cast(current_mana) / max_mana) * 100); } diff --git a/zone/perl_mob.cpp b/zone/perl_mob.cpp index e300a121d..668857fc1 100644 --- a/zone/perl_mob.cpp +++ b/zone/perl_mob.cpp @@ -770,7 +770,7 @@ XS(XS_Mob_SetHP) { Perl_croak(aTHX_ "Usage: Mob::SetHP(THIS, int64 hp)"); // @categories Stats and Attributes { Mob *THIS; - int64 hp = (int32) SvIV(ST(1)); + int64 hp = (int64) SvIV(ST(1)); VALIDATE_THIS_IS_MOB; THIS->SetHP(hp); } @@ -1630,7 +1630,7 @@ XS(XS_Mob_GetSpellHPBonuses) { Perl_croak(aTHX_ "Usage: Mob::GetSpellHPBonuses(THIS)"); // @categories Spells and Disciplines { Mob *THIS; - int32 RETVAL; + int64 RETVAL; dXSTARG; VALIDATE_THIS_IS_MOB; RETVAL = THIS->GetSpellHPBonuses();