Skip to content

Commit 18db95f

Browse files
committed
fix if checking for ignored race, handle possibility of not existhing function to read persistent site config int
1 parent 30eb002 commit 18db95f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

nestboxes.lua

+6-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ local function persist_state()
9393
end
9494

9595
local function read_persistent_config(key, index)
96-
return dfhack.internal.readPersistentSiteConfigInt(key, index)
96+
if dfhack.internal.readPersistentSiteConfigInt ~= nil then
97+
return dfhack.internal.readPersistentSiteConfigInt(key, index)
98+
else
99+
return nil
100+
end
97101
end
98102

99103
local function migrate_enabled_status_from_cpp_nestboxes()
@@ -384,7 +388,7 @@ local function handle_eggs(eggs)
384388
if ignore then
385389
print_details(("race is ignored, nothing to do here"))
386390
return
387-
end if;
391+
end
388392

389393
print_details(("max_eggs %s "):format(max_eggs))
390394
print_details(("count_children %s "):format(count_children))

0 commit comments

Comments
 (0)