From 72b32ea2f8fe13694a379de8e02880c8b682e0ef Mon Sep 17 00:00:00 2001 From: Nicholas McDaniel Date: Sat, 22 Feb 2025 21:03:35 -0500 Subject: [PATCH] Prevent flow_forbid from being set without liquid present --- changelog.txt | 1 + modtools/spawn-liquid.lua | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/changelog.txt b/changelog.txt index 4965da0d76..c632f6f75f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -36,6 +36,7 @@ Template for new versions: ## Fixes - `position`: support for adv mode look cursor +- `gui/liquids`: using the remove tool with magma selected will no longer create unexpected unpathable tiles ## Misc Improvements - `hide-tutorials`: handle tutorial popups for adventure mode diff --git a/modtools/spawn-liquid.lua b/modtools/spawn-liquid.lua index 419b0b4595..9a3d2417e8 100644 --- a/modtools/spawn-liquid.lua +++ b/modtools/spawn-liquid.lua @@ -21,6 +21,10 @@ function spawnLiquid(position, liquid_level, liquid_type) local map_block = dfhack.maps.getTileBlock(position) local tile = dfhack.maps.getTileFlags(position) + if liquid_level == 0 then + liquid_type = df.tile_liquid.Water + end + tile.flow_size = liquid_level or 3 tile.liquid_type = liquid_type tile.flow_forbid = liquid_type == df.tile_liquid.Magma or liquid_level >= 4 @@ -34,6 +38,8 @@ function spawnLiquid(position, liquid_level, liquid_type) z_level.update = true z_level.update_twice = true + df.global.world.reindex_pathfinding = true + resetTemperature(position) end