Skip to content

Commit

Permalink
fix a crash where bookshelves was not defined yet
Browse files Browse the repository at this point in the history
  • Loading branch information
FaceDeer committed Feb 5, 2020
1 parent fe4c392 commit dad5df2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion settlements/bookgen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ minetest.register_abm({
local book = town_def.generate_book(closest_settlement.pos, town_name)
if book then
inv:add_item("books", book)
bookshelf_on_construct(pos) -- this should safely update the bookshelf's infotext without disturbing its contents
if bookshelf_on_construct then
bookshelf_on_construct(pos) -- this should safely update the bookshelf's infotext without disturbing its contents
end
end
end
end,
Expand Down
2 changes: 1 addition & 1 deletion settlements/mod.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = settlements
description = API for adding small settlements to map generation.
depends = named_waypoints
optional_depends = commoditymarket, intllib
optional_depends = commoditymarket, intllib, default

0 comments on commit dad5df2

Please sign in to comment.