fix crash when setting tech recipe
This commit is contained in:
parent
364a2d4d16
commit
6ec53fab5e
4 changed files with 19 additions and 7 deletions
|
|
@ -51,6 +51,13 @@ function data_util.remove_raw(t, name)
|
|||
end
|
||||
end
|
||||
|
||||
-- Set technology recipe
|
||||
function data_util.set_tech_recipe(technology_name, ingredients)
|
||||
if data.raw.technology[technology_name] then
|
||||
data.raw.technology[technology_name].unit.ingredients = ingredients
|
||||
end
|
||||
end
|
||||
|
||||
-- Add a prerequisite to a given technology
|
||||
function data_util.add_prerequisite(technology_name, prerequisite)
|
||||
technology = data.raw.technology[technology_name]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue