Skip to content

Commit

Permalink
Merge pull request #6652 from LandSandBoat/takespelldmg-attacker-type
Browse files Browse the repository at this point in the history
Change battleutils::TakeSpellDamage() attacker param to CBattleEntity
  • Loading branch information
zach2good authored Jan 5, 2025
2 parents 0924f3f + eba1f44 commit 5ed8232
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/map/lua/lua_baseentity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14740,8 +14740,8 @@ int32 CLuaBaseEntity::takeSpellDamage(CLuaBaseEntity* caster, CLuaSpell* spell,
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 @@ -14751,7 +14751,7 @@ int32 CLuaBaseEntity::takeSpellDamage(CLuaBaseEntity* caster, CLuaSpell* spell,
ATTACK_TYPE attackType = static_cast<ATTACK_TYPE>(atkType);
DAMAGE_TYPE damageType = static_cast<DAMAGE_TYPE>(dmgType);

return battleutils::TakeSpellDamage(PBattleDefender, PChar, PSpell, damage, attackType, damageType);
return battleutils::TakeSpellDamage(PBattleDefender, PBattleAttacker, PSpell, 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 @@ -2575,7 +2575,7 @@ namespace battleutils
* *
************************************************************************/

int32 TakeSpellDamage(CBattleEntity* PDefender, CCharEntity* PAttacker, CSpell* PSpell, int32 damage, ATTACK_TYPE attackType, DAMAGE_TYPE damageType)
int32 TakeSpellDamage(CBattleEntity* PDefender, CBattleEntity* PAttacker, CSpell* PSpell, int32 damage, ATTACK_TYPE attackType, DAMAGE_TYPE damageType)
{
// Scarlet Delirium: Updates status effect power with damage bonus
battleutils::HandleScarletDelirium(PDefender, damage);
Expand Down
2 changes: 1 addition & 1 deletion src/map/utils/battleutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ namespace battleutils
int32 TakeWeaponskillDamage(CBattleEntity* PAttacker, CBattleEntity* PDefender, int32 damage, ATTACK_TYPE attackType, DAMAGE_TYPE damageType, uint8 slot,
bool primary, float tpMultiplier, uint16 bonusTP, float targetTPMultiplier);
int32 TakeSkillchainDamage(CBattleEntity* PAttacker, CBattleEntity* PDefender, int32 lastSkillDamage, CBattleEntity* taChar);
int32 TakeSpellDamage(CBattleEntity* PDefender, CCharEntity* PAttacker, CSpell* PSpell, int32 damage, ATTACK_TYPE attackType, DAMAGE_TYPE damageType);
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);

bool TryInterruptSpell(CBattleEntity* PAttacker, CBattleEntity* PDefender, CSpell* PSpell);
Expand Down

0 comments on commit 5ed8232

Please sign in to comment.