mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-27 08:24:11 +00:00
battle_calcs: provide default value for resistance modifiers
This is done for cases when the value cannot be read from the unit_info table, which might happen in some UMC. This fixes a rare bug affecting the Fast Micro AI attack evaluation
This commit is contained in:
parent
ac262a15d4
commit
9e8ee00ad0
@ -115,7 +115,7 @@ function battle_calcs.strike_damage(attacker, defender, att_weapon, def_weapon,
|
||||
local att_damage = attacker_info.attacks[att_weapon].damage
|
||||
|
||||
-- Opponent resistance modifier
|
||||
local att_multiplier = defender_info.resist_mod[attacker_info.attacks[att_weapon].type]
|
||||
local att_multiplier = defender_info.resist_mod[attacker_info.attacks[att_weapon].type] or 1
|
||||
|
||||
-- TOD modifier
|
||||
att_multiplier = att_multiplier * AH.get_unit_time_of_day_bonus(attacker_info.alignment, att_lawful_bonus)
|
||||
@ -127,7 +127,7 @@ function battle_calcs.strike_damage(attacker, defender, att_weapon, def_weapon,
|
||||
def_damage = defender_info.attacks[def_weapon].damage
|
||||
|
||||
-- Opponent resistance modifier
|
||||
def_multiplier = attacker_info.resist_mod[defender_info.attacks[def_weapon].type]
|
||||
def_multiplier = attacker_info.resist_mod[defender_info.attacks[def_weapon].type] or 1
|
||||
|
||||
-- TOD modifier
|
||||
def_multiplier = def_multiplier * AH.get_unit_time_of_day_bonus(defender_info.alignment, def_lawful_bonus)
|
||||
|
Loading…
x
Reference in New Issue
Block a user