Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TakeSwipeLungeDamage, CalculateBaseTP parameter types #6657

Merged
merged 1 commit into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/map/lua/lua_baseentity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14770,8 +14770,8 @@ int32 CLuaBaseEntity::takeSwipeLungeDamage(CLuaBaseEntity* caster, int32 damage,
return 0;
}

auto* PChar = dynamic_cast<CCharEntity*>(caster->m_PBaseEntity);
if (!PChar)
auto* PBattleAttacker = dynamic_cast<CBattleEntity*>(caster->m_PBaseEntity);
if (!PBattleAttacker)
{
ShowWarning("Invalid entity type passed as Attacker (%s).", m_PBaseEntity->getName());
return 0;
Expand All @@ -14780,7 +14780,7 @@ int32 CLuaBaseEntity::takeSwipeLungeDamage(CLuaBaseEntity* caster, int32 damage,
ATTACK_TYPE attackType = static_cast<ATTACK_TYPE>(atkType);
DAMAGE_TYPE damageType = static_cast<DAMAGE_TYPE>(dmgType);

return battleutils::TakeSwipeLungeDamage(PBattleDefender, PChar, damage, attackType, damageType);
return battleutils::TakeSwipeLungeDamage(PBattleDefender, PBattleAttacker, damage, attackType, damageType);
}

/************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion src/map/utils/battleutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2611,7 +2611,7 @@ namespace battleutils
* *
************************************************************************/

int32 TakeSwipeLungeDamage(CBattleEntity* PDefender, CCharEntity* PAttacker, int32 damage, ATTACK_TYPE attackType, DAMAGE_TYPE damageType)
int32 TakeSwipeLungeDamage(CBattleEntity* PDefender, CBattleEntity* PAttacker, int32 damage, ATTACK_TYPE attackType, DAMAGE_TYPE damageType)
{
damage = CheckAndApplyDamageCap(damage, PDefender);

Expand Down
5 changes: 2 additions & 3 deletions src/map/utils/battleutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ namespace battleutils
uint8 CheckMultiHits(CBattleEntity* PEntity, CItemWeapon* PWeapon);

uint8 getHitCount(uint8 hits);
uint8 CheckMobMultiHits(CBattleEntity* PEntity);

int16 GetSnapshotReduction(CBattleEntity* battleEntity, int16 delay);
int32 GetRangedAttackBonuses(CBattleEntity* battleEntity);
Expand Down Expand Up @@ -162,7 +161,7 @@ namespace battleutils
bool primary, float tpMultiplier, uint16 bonusTP, float targetTPMultiplier);
int32 TakeSkillchainDamage(CBattleEntity* PAttacker, CBattleEntity* PDefender, int32 lastSkillDamage, CBattleEntity* taChar);
int32 TakeSpellDamage(CBattleEntity* PDefender, CBattleEntity* PAttacker, CSpell* PSpell, int32 damage, ATTACK_TYPE attackType, DAMAGE_TYPE damageType);
int32 TakeSwipeLungeDamage(CBattleEntity* PDefender, CCharEntity* PAttacker, int32 damage, ATTACK_TYPE attackType, DAMAGE_TYPE damageType);
int32 TakeSwipeLungeDamage(CBattleEntity* PDefender, CBattleEntity* PAttacker, int32 damage, ATTACK_TYPE attackType, DAMAGE_TYPE damageType);

bool TryInterruptSpell(CBattleEntity* PAttacker, CBattleEntity* PDefender, CSpell* PSpell);
float GetRangedDamageRatio(CBattleEntity* PAttacker, CBattleEntity* PDefender, bool isCritical, int16 bonusRangedAttack);
Expand All @@ -181,7 +180,7 @@ namespace battleutils
int16 GetEnmityModCure(int16 level);
bool isValidSelfTargetWeaponskill(int wsid);
bool CanUseWeaponskill(CCharEntity* PChar, CWeaponSkill* PSkill);
int16 CalculateBaseTP(int delay);
int16 CalculateBaseTP(int32 delay);
void GenerateCureEnmity(CBattleEntity* PSource, CBattleEntity* PTarget, int32 amount, int32 fixedCE = 0, int32 fixedVE = 0);
void GenerateInRangeEnmity(CBattleEntity* PSource, int16 CE, int16 VE);

Expand Down
Loading