[INT64] Further int64 cleanup in Perl SetHP() and GetSpellHPBonuses() in Perl/Lua. (#2222)

This commit is contained in:
Kinglykrab 2022-05-29 17:36:32 -04:00 committed by GitHub
parent d493a6627b
commit 11369247b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions

View File

@ -497,7 +497,7 @@ int64 Lua_Mob::GetItemHPBonuses() {
return self->GetItemHPBonuses(); return self->GetItemHPBonuses();
} }
int Lua_Mob::GetSpellHPBonuses() { int64 Lua_Mob::GetSpellHPBonuses() {
Lua_Safe_Call_Int(); Lua_Safe_Call_Int();
return self->GetSpellHPBonuses(); return self->GetSpellHPBonuses();
} }

View File

@ -126,7 +126,7 @@ public:
int64 GetHP(); int64 GetHP();
int64 GetMaxHP(); int64 GetMaxHP();
int64 GetItemHPBonuses(); int64 GetItemHPBonuses();
int GetSpellHPBonuses(); int64 GetSpellHPBonuses();
double GetWalkspeed(); double GetWalkspeed();
double GetRunspeed(); double GetRunspeed();
int GetCasterLevel(int spell_id); int GetCasterLevel(int spell_id);

View File

@ -981,8 +981,8 @@ int64 Mob::GetItemHPBonuses() {
return item_hp; return item_hp;
} }
int32 Mob::GetSpellHPBonuses() { int64 Mob::GetSpellHPBonuses() {
int32 spell_hp = 0; int64 spell_hp = 0;
spell_hp = spellbonuses.HP; spell_hp = spellbonuses.HP;
spell_hp += spell_hp * spellbonuses.MaxHPChange / 10000; spell_hp += spell_hp * spellbonuses.MaxHPChange / 10000;
return spell_hp; return spell_hp;

View File

@ -608,7 +608,7 @@ public:
virtual int64 GetMaxEndurance() const { return 0; } virtual int64 GetMaxEndurance() const { return 0; }
virtual void SetEndurance(int32 newEnd) { return; } virtual void SetEndurance(int32 newEnd) { return; }
int64 GetItemHPBonuses(); int64 GetItemHPBonuses();
int32 GetSpellHPBonuses(); int64 GetSpellHPBonuses();
virtual const int64& SetMana(int64 amount); virtual const int64& SetMana(int64 amount);
inline float GetManaRatio() const { return max_mana == 0 ? 100 : inline float GetManaRatio() const { return max_mana == 0 ? 100 :
((static_cast<float>(current_mana) / max_mana) * 100); } ((static_cast<float>(current_mana) / max_mana) * 100); }

View File

@ -770,7 +770,7 @@ XS(XS_Mob_SetHP) {
Perl_croak(aTHX_ "Usage: Mob::SetHP(THIS, int64 hp)"); // @categories Stats and Attributes Perl_croak(aTHX_ "Usage: Mob::SetHP(THIS, int64 hp)"); // @categories Stats and Attributes
{ {
Mob *THIS; Mob *THIS;
int64 hp = (int32) SvIV(ST(1)); int64 hp = (int64) SvIV(ST(1));
VALIDATE_THIS_IS_MOB; VALIDATE_THIS_IS_MOB;
THIS->SetHP(hp); THIS->SetHP(hp);
} }
@ -1630,7 +1630,7 @@ XS(XS_Mob_GetSpellHPBonuses) {
Perl_croak(aTHX_ "Usage: Mob::GetSpellHPBonuses(THIS)"); // @categories Spells and Disciplines Perl_croak(aTHX_ "Usage: Mob::GetSpellHPBonuses(THIS)"); // @categories Spells and Disciplines
{ {
Mob *THIS; Mob *THIS;
int32 RETVAL; int64 RETVAL;
dXSTARG; dXSTARG;
VALIDATE_THIS_IS_MOB; VALIDATE_THIS_IS_MOB;
RETVAL = THIS->GetSpellHPBonuses(); RETVAL = THIS->GetSpellHPBonuses();