Merge pull request #808 from BenLubar/benlubar-floodgate-alloc

Fix floodgate allocation in C++/Lua and well and pressure plate allocation in Ruby.
develop
Lethosor 2016-01-31 14:20:46 -05:00
commit d063155b87
2 changed files with 9 additions and 1 deletions

@ -73,6 +73,7 @@ using namespace DFHack;
#include "df/building_water_wheelst.h" #include "df/building_water_wheelst.h"
#include "df/building_wellst.h" #include "df/building_wellst.h"
#include "df/building_rollersst.h" #include "df/building_rollersst.h"
#include "df/building_floodgatest.h"
using namespace df::enums; using namespace df::enums;
using df::global::ui; using df::global::ui;
@ -369,6 +370,12 @@ df::building *Buildings::allocInstance(df::coord pos, df::building_type type, in
obj->ready_timeout = 500; obj->ready_timeout = 500;
break; break;
} }
case building_type::Floodgate:
{
auto obj = (df::building_floodgatest*)bld;
obj->gate_flags.bits.closed = true;
break;
}
default: default:
break; break;
} }

@ -57,9 +57,10 @@ module DFHack
bld.setSubtype(subtype) bld.setSubtype(subtype)
bld.setCustomType(custom) bld.setCustomType(custom)
case type case type
when :Well; bld.bucket_z = bld.z
when :Furnace; bld.melt_remainder[world.raws.inorganics.length] = 0 when :Furnace; bld.melt_remainder[world.raws.inorganics.length] = 0
when :Coffin; bld.initBurialFlags when :Coffin; bld.initBurialFlags
when :Trap; bld.unk_cc = 500 if bld.trap_type == :PressurePlate when :Trap; bld.ready_timeout = 500 if bld.trap_type == :PressurePlate
when :Floodgate; bld.gate_flags.closed = true when :Floodgate; bld.gate_flags.closed = true
end end
bld bld