Skip to content

Commit

Permalink
Fix lua crash when setting buildup intensity to units that no longer …
Browse files Browse the repository at this point in the history
…exist
  • Loading branch information
Dugy committed Jun 25, 2024
1 parent 9552d87 commit 7c6eb38
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,9 @@ local function set_buildup_ability_intensity(cfg, tag_name, ability_type, abilit
local debug = cfg.debug or false
local unit_id = cfg.id or wml.error(tag_name .. ": missing required id=")
local unit_base = wesnoth.units.find({ id = unit_id})[1]
if unit_base == nil then
return
end
local unit = unit_base.__cfg
local abilities = wml.get_child(unit, "abilities")
local latent_ability = wml.get_child(abilities, ability_type, ability_id)
Expand Down

0 comments on commit 7c6eb38

Please sign in to comment.