summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorjj2012-09-23 11:44:27 +0200
committerjj2012-09-23 11:44:27 +0200
commitf2199c2951e195a8ee496fd75ee5b512d6e3e15e (patch)
treea6ac56a5247b050d4a8283ad1d39aeda2bf18436 /plugins
parentf7272e4a8f09d11ee41b068277de1f61993cfaa8 (diff)
downloaddfhack-f2199c2951e195a8ee496fd75ee5b512d6e3e15e.tar.gz
dfhack-f2199c2951e195a8ee496fd75ee5b512d6e3e15e.tar.bz2
dfhack-f2199c2951e195a8ee496fd75ee5b512d6e3e15e.tar.xz
ruby: fix activity zone_num
Diffstat (limited to 'plugins')
-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