set floodgate flags correctly when allocating it in lua or c++

https://github.com/DFHack/dfhack/blob/0.42.04-alpha2/plugins/ruby/building.rb#L63
develop
Ben Lubar 2016-01-29 14:50:29 -06:00
parent 7f3191352c
commit a316dfa074
1 changed files with 7 additions and 0 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;
} }