From f2199c2951e195a8ee496fd75ee5b512d6e3e15e Mon Sep 17 00:00:00 2001 From: jj Date: Sun, 23 Sep 2012 11:44:27 +0200 Subject: [PATCH] ruby: fix activity zone_num --- plugins/ruby/building.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/ruby/building.rb b/plugins/ruby/building.rb index 68229c007..3f8842b44 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