Fixed broken buildings, also added floodgate functionality.

Merge branch 'master' of git://github.com/JapaMala/dfhack
develop
Japa 2013-06-28 21:17:54 +03:00 committed by Warmist
parent 0cf5eedc2a
commit b248eb3e52
3 changed files with 10 additions and 1 deletions

@ -21,6 +21,7 @@
#include "df/world.h"
#include "df/building.h"
#include "df/building_doorst.h"
#include "df/building_floodgatest.h"
#include "df/plant.h"
#include "df/plant_raw.h"
@ -903,6 +904,12 @@ void lightingEngineViewscreen::doOcupancyAndLights()
if(!door->door_flags.bits.closed)
continue;
}
else if(type==df::enums::building_type::Floodgate)
{
df::building_floodgatest* gate=static_cast<df::building_floodgatest*>(bld);
if(!gate->gate_flags.bits.closed)
continue;
}
if(def->useMaterial)

@ -128,6 +128,7 @@ struct buildingLightDef
bool useMaterial;
float thickness;
float size;
buildingLightDef():poweredOnly(false),useMaterial(true),thickness(1.0f),size(1.0f){}
};
class lightingEngineViewscreen:public lightingEngine
{

@ -146,3 +146,4 @@ addBuilding("Bed",{1,1,1},{0.3,0.2,0.0},2)
addBuilding("WindowGlass",nil,nil,0,{"useMaterial"})
addBuilding("WindowGem",nil,nil,0,{"useMaterial"})
addBuilding("Door",nil,nil,0,{"useMaterial"}) -- special case, only closed door obstruct/emit light
addBuilding("Floodgate",nil,nil,0,{"useMaterial"}) -- special case, only closed door obstruct/emit light