Fixed a deadlock if a spell ward had redirect damage for self, it kept looping into CheckWards on the victim
This commit is contained in:
parent
25f71b36be
commit
9038e3a2ff
@ -1047,7 +1047,7 @@ Skill* Entity::GetSkillByWeaponType(int8 type, int8 damage_type, bool update) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Entity::DamageSpawn(Entity* victim, int8 type, int8 damage_type, int32 low_damage, int32 high_damage, const char* spell_name, int8 crit_mod, bool is_tick, bool no_calcs, bool ignore_attacker, bool take_power, LuaSpell* spell) {
|
bool Entity::DamageSpawn(Entity* victim, int8 type, int8 damage_type, int32 low_damage, int32 high_damage, const char* spell_name, int8 crit_mod, bool is_tick, bool no_calcs, bool ignore_attacker, bool take_power, LuaSpell* spell, bool skip_check_wards) {
|
||||||
if(spell) {
|
if(spell) {
|
||||||
spell->is_damage_spell = true;
|
spell->is_damage_spell = true;
|
||||||
}
|
}
|
||||||
@ -1162,6 +1162,7 @@ bool Entity::DamageSpawn(Entity* victim, int8 type, int8 damage_type, int32 low_
|
|||||||
|
|
||||||
if(damage) {
|
if(damage) {
|
||||||
int32 prevDmg = damage;
|
int32 prevDmg = damage;
|
||||||
|
if(!skip_check_wards)
|
||||||
damage = victim->CheckWards(this, damage, damage_type);
|
damage = victim->CheckWards(this, damage, damage_type);
|
||||||
|
|
||||||
if (damage < (sint64)prevDmg)
|
if (damage < (sint64)prevDmg)
|
||||||
|
@ -2387,7 +2387,7 @@ int32 Entity::CheckWards(Entity* attacker, int32 damage, int8 damage_type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (attacker && spell->caster)
|
if (attacker && spell->caster)
|
||||||
attacker->DamageSpawn(spell->caster, DAMAGE_PACKET_TYPE_SPELL_DAMAGE, damage_type, redirectDamage, redirectDamage, 0, 0, false, false, false, false, spell);
|
attacker->DamageSpawn(spell->caster, DAMAGE_PACKET_TYPE_SPELL_DAMAGE, damage_type, redirectDamage, redirectDamage, 0, 0, false, false, false, false, spell, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool shouldRemoveSpell = false;
|
bool shouldRemoveSpell = false;
|
||||||
|
@ -1558,7 +1558,7 @@ public:
|
|||||||
int8 DetermineHit(Spawn* victim, int8 type, int8 damage_type, float ToHitBonus, bool is_caster_spell, LuaSpell* lua_spell = nullptr);
|
int8 DetermineHit(Spawn* victim, int8 type, int8 damage_type, float ToHitBonus, bool is_caster_spell, LuaSpell* lua_spell = nullptr);
|
||||||
float GetDamageTypeResistPercentage(int8 damage_type);
|
float GetDamageTypeResistPercentage(int8 damage_type);
|
||||||
Skill* GetSkillByWeaponType(int8 type, int8 damage_type, bool update);
|
Skill* GetSkillByWeaponType(int8 type, int8 damage_type, bool update);
|
||||||
bool DamageSpawn(Entity* victim, int8 type, int8 damage_type, int32 low_damage, int32 high_damage, const char* spell_name, int8 crit_mod = 0, bool is_tick = false, bool no_damage_calcs = false, bool ignore_attacker = false, bool take_power = false, LuaSpell* spell = 0);
|
bool DamageSpawn(Entity* victim, int8 type, int8 damage_type, int32 low_damage, int32 high_damage, const char* spell_name, int8 crit_mod = 0, bool is_tick = false, bool no_damage_calcs = false, bool ignore_attacker = false, bool take_power = false, LuaSpell* spell = 0, bool skip_check_wards = false);
|
||||||
float CalculateMitigation(int8 type = DAMAGE_PACKET_TYPE_SIMPLE_DAMAGE, int8 damage_type = 0, int16 attacker_level = 0, bool for_pvp = false);
|
float CalculateMitigation(int8 type = DAMAGE_PACKET_TYPE_SIMPLE_DAMAGE, int8 damage_type = 0, int16 attacker_level = 0, bool for_pvp = false);
|
||||||
void AddHate(Entity* attacker, sint32 hate, bool ignore_pet_behavior = false);
|
void AddHate(Entity* attacker, sint32 hate, bool ignore_pet_behavior = false);
|
||||||
bool CheckInterruptSpell(Entity* attacker);
|
bool CheckInterruptSpell(Entity* attacker);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user