diff options
| author | jj | 2012-09-12 17:38:00 +0200 |
|---|---|---|
| committer | jj | 2012-09-12 20:59:37 +0200 |
| commit | 19a150fb38cc3b148995fcf6692bef1116c0b529 (patch) | |
| tree | 7a3e46bcd75ef397badb16474bf17166f854021a /plugins/ruby | |
| parent | cda17954c81973318b6214a47a463dee0024a77f (diff) | |
| download | dfhack-19a150fb38cc3b148995fcf6692bef1116c0b529.tar.gz dfhack-19a150fb38cc3b148995fcf6692bef1116c0b529.tar.bz2 dfhack-19a150fb38cc3b148995fcf6692bef1116c0b529.tar.xz | |
ruby: fix dig smooth overdigging
Diffstat (limited to 'plugins/ruby')
| -rw-r--r-- | plugins/ruby/map.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/ruby/map.rb b/plugins/ruby/map.rb index 5b4e9421..d662a343 100644 --- a/plugins/ruby/map.rb +++ b/plugins/ruby/map.rb @@ -190,16 +190,20 @@ module DFHack def dig(mode=:Default) if mode == :Smooth - if tilemat != :SOIL and caption !~ /smooth|pillar/i # XXX - # need to check if already smooth, otherwise re-setting - # des.smooth will carve a fortification + if tilemat != :SOIL and caption !~ /smooth|pillar|fortification/i and # XXX caption.. + designation.smooth == 0 and not df.world.job_list.find { |j| + # the game removes 'smooth' designation as soon as it assigns a job, if we + # re-set it the game may queue another :DetailWall that will carve a fortification + (j.job_type == :DetailWall or j.job_type == :DetailFloor) and df.same_pos?(j, self) + } designation.dig = :No designation.smooth = 1 + mapblock.flags.designated = true end else designation.dig = mode + mapblock.flags.designated = true if mode != :No end - mapblock.flags.designated = true if mode != :No end def spawn_liquid(quantity, is_magma=false, flowing=true) |
