Skip to content

Commit c33f345

Browse files
committed
Fix subterranean temperature
1 parent 111626c commit c33f345

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

plugins/tiletypes.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ static const std::map<std::pair<df::tiletype_shape, df::tiletype_shape>, df::til
8080
{ { df::tiletype_shape::RAMP, df::tiletype_shape::EMPTY }, df::tiletype_shape::RAMP_TOP },
8181
{ { df::tiletype_shape::EMPTY, df::tiletype_shape::RAMP_TOP }, df::tiletype_shape::EMPTY },
8282
};
83+
static const uint16_t UNDERGROUND_TEMP = 10015;
8384

8485
static const char * HISTORY_FILE = "dfhack-config/tiletypes.history";
8586
CommandHistory tiletypes_hist;
@@ -860,9 +861,16 @@ static bool paintTileProcessing(MapExtras::Block* block, const df::coord2d& bloc
860861
if (target.light > -1)
861862
des.bits.light = target.light;
862863

863-
if (target.subterranean > -1)
864+
if (target.subterranean > -1) {
864865
des.bits.subterranean = target.subterranean;
865866

867+
// Underground tiles have a fixed ambient temperature, though magma and fire can raise it
868+
if (target.subterranean == 1 && block->temperature1At(blockPos) < UNDERGROUND_TEMP) {
869+
block->setTemp1At(blockPos, UNDERGROUND_TEMP);
870+
block->setTemp2At(blockPos, UNDERGROUND_TEMP);
871+
}
872+
}
873+
866874
if (target.skyview > -1)
867875
des.bits.outside = target.skyview;
868876

0 commit comments

Comments
 (0)