Fixed an issue with bReduceDamageReturn (#5722)

Fixed #5650
Thanks to @eppc0330, Lemongrass3110 !
This commit is contained in:
Atemo 2021-01-26 01:38:50 +01:00 committed by GitHub
parent 8216a6d7f7
commit 6b8e369da3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 8 deletions

View File

@ -7374,10 +7374,12 @@ int64 battle_calc_return_damage(struct block_list* bl, struct block_list *src, i
}
}
if (sd && sd->bonus.reduce_damage_return != 0) {
rdamage -= rdamage * sd->bonus.reduce_damage_return / 100;
if (rdamage < 1)
rdamage = 1;
if (rdamage > 0) {
map_session_data* ssd = BL_CAST(BL_PC, src);
if (ssd && ssd->bonus.reduce_damage_return != 0) {
rdamage -= rdamage * ssd->bonus.reduce_damage_return / 100;
rdamage = i64max(rdamage, 1);
}
}
if (ssc) {

View File

@ -3430,10 +3430,9 @@ int64 skill_attack (int attack_type, struct block_list* src, struct block_list *
dmg.damage -= dmg.damage * (6 * (1+per)) / 100;
}
if (sd && sd->bonus.reduce_damage_return != 0) {
dmg.damage -= dmg.damage * sd->bonus.reduce_damage_return / 100;
if (dmg.damage < 1)
dmg.damage = 1;
if (dmg.damage > 0 && tsd && tsd->bonus.reduce_damage_return != 0) {
dmg.damage -= dmg.damage * tsd->bonus.reduce_damage_return / 100;
dmg.damage = i64max(dmg.damage, 1);
}
}
#endif