Fixed broken buildings, also added floodgate functionality.

develop
Japa 2013-06-28 23:47:54 +05:30
parent b9634098a9
commit 102b2ed450
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)

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

@ -145,4 +145,5 @@ addBuilding("Statue",{1,1,1},{0.9,0.75,0.3},8)
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("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