summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/ruby/building.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/ruby/building.rb b/plugins/ruby/building.rb
index 68229c00..3f8842b4 100644
--- a/plugins/ruby/building.rb
+++ b/plugins/ruby/building.rb
@@ -299,9 +299,13 @@ module DFHack
# construct an abstract building (stockpile, farmplot, ...)
def building_construct_abstract(bld)
- if bld.getType == :Stockpile
+ case bld.getType
+ when :Stockpile
max = df.world.buildings.other[:STOCKPILE].map { |s| s.stockpile_number }.max
bld.stockpile_number = max.to_i + 1
+ when :Civzone
+ max = df.world.buildings.other[:ANY_ZONE].map { |z| z.zone_num }.max
+ bld.zone_num = max.to_i + 1
end
building_link bld
if !bld.flags.exists