Preventing a stockflow error message in Arena mode

develop
Eric Wald 2015-03-15 14:08:47 -06:00
parent 3639920a50
commit d18bd3e2a5
2 changed files with 7 additions and 0 deletions

@ -19,6 +19,7 @@ DFHack Future
hack-wish: Made items stack properly.
modtools/skill-change: made level granularity work properly.
show-unit-syndromes should work
stockflow: Fixed error message in Arena mode
zone: Stopped crash when scrolling cage owner list
New Plugins
New Scripts

@ -387,6 +387,12 @@ function collect_reactions()
-- Not all reactions are allowed to the civilization.
-- That includes "Make sharp rock" by default.
local entity = df.historical_entity.find(df.global.ui.civ_id)
if not entity then
-- No global civilization; arena mode?
-- Anyway, skip remaining reactions, since many depend on the civ.
return result
end
for _, reaction_id in ipairs(entity.entity_raw.workshops.permitted_reaction_id) do
local reaction = df.global.world.raws.reactions[reaction_id]
local name = string.gsub(reaction.name, "^.", string.upper)