Skip to content

Commit b248eb3

Browse files
RosaryMalawarmist
authored andcommitted
Fixed broken buildings, also added floodgate functionality.
Merge branch 'master' of git://github.com/JapaMala/dfhack
1 parent 0cf5eed commit b248eb3

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

plugins/rendermax/renderer_light.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "df/world.h"
2222
#include "df/building.h"
2323
#include "df/building_doorst.h"
24+
#include "df/building_floodgatest.h"
2425
#include "df/plant.h"
2526
#include "df/plant_raw.h"
2627

@@ -903,6 +904,12 @@ void lightingEngineViewscreen::doOcupancyAndLights()
903904
if(!door->door_flags.bits.closed)
904905
continue;
905906
}
907+
else if(type==df::enums::building_type::Floodgate)
908+
{
909+
df::building_floodgatest* gate=static_cast<df::building_floodgatest*>(bld);
910+
if(!gate->gate_flags.bits.closed)
911+
continue;
912+
}
906913

907914

908915
if(def->useMaterial)

plugins/rendermax/renderer_light.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ struct buildingLightDef
128128
bool useMaterial;
129129
float thickness;
130130
float size;
131+
buildingLightDef():poweredOnly(false),useMaterial(true),thickness(1.0f),size(1.0f){}
131132
};
132133
class lightingEngineViewscreen:public lightingEngine
133134
{

plugins/rendermax/rendermax.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,5 @@ addBuilding("Statue",{1,1,1},{0.9,0.75,0.3},8)
145145
addBuilding("Bed",{1,1,1},{0.3,0.2,0.0},2)
146146
addBuilding("WindowGlass",nil,nil,0,{"useMaterial"})
147147
addBuilding("WindowGem",nil,nil,0,{"useMaterial"})
148-
addBuilding("Door",nil,nil,0,{"useMaterial"}) -- special case, only closed door obstruct/emit light
148+
addBuilding("Door",nil,nil,0,{"useMaterial"}) -- special case, only closed door obstruct/emit light
149+
addBuilding("Floodgate",nil,nil,0,{"useMaterial"}) -- special case, only closed door obstruct/emit light

0 commit comments

Comments
 (0)