Skip to content

Commit

Permalink
Merge pull request #1408 from NicksWorld/fix/magma_pathability
Browse files Browse the repository at this point in the history
Prevent flow_forbid from being set without liquid present
  • Loading branch information
myk002 authored Feb 23, 2025
2 parents 03fc4b2 + 72b32ea commit 557ac57
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,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
Expand Down
6 changes: 6 additions & 0 deletions modtools/spawn-liquid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 557ac57

Please sign in to comment.