Lua AI utility functions: fix for chance-to-hit specials without id

All mainline chance-to-hit weapon specials have ids, but it is not required for UMC specials.

(cherry-picked from commit 5335a2af33)
This commit is contained in:
mattsc 2018-08-29 07:27:24 -07:00
parent 3906d78abd
commit 6ad4c7e42d

View file

@ -54,7 +54,7 @@ function battle_calcs.unit_attack_info(unit, cache)
else
-- magical, marksman
if (sp[1] == 'chance_to_hit') then
a[sp[2].id] = true
a[sp[2].id or 'no_id'] = true
else
a[sp[1]] = true
end