diff options
| author | Jared Adams | 2012-05-08 07:32:35 -0600 |
|---|---|---|
| committer | Jared Adams | 2012-05-08 07:32:35 -0600 |
| commit | dce7f17fe78596734d0300021f95fb6f22e2b730 (patch) | |
| tree | 2a01575b42ad73c48ab8bfa82386648d0e17b670 /plugins/liquids.cpp | |
| parent | 5bd90e28b865de4ac4d766546e82b8f547b9ffeb (diff) | |
| parent | fca618ff1baa48ad839317ed6d7479d34f110248 (diff) | |
| download | dfhack-dce7f17fe78596734d0300021f95fb6f22e2b730.tar.gz dfhack-dce7f17fe78596734d0300021f95fb6f22e2b730.tar.bz2 dfhack-dce7f17fe78596734d0300021f95fb6f22e2b730.tar.xz | |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'plugins/liquids.cpp')
| -rw-r--r-- | plugins/liquids.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/liquids.cpp b/plugins/liquids.cpp index 1ecf98b1..2d568c20 100644 --- a/plugins/liquids.cpp +++ b/plugins/liquids.cpp @@ -365,6 +365,10 @@ command_result df_liquids_execute(color_ostream &out) DFHack::DFCoord cursor(x,y,z); coord_vec all_tiles = brush->points(mcache,cursor); out << "working..." << endl; + + // Force the game to recompute its walkability cache + df::global::world->reindex_pathfinding = true; + if(mode == "obsidian") { coord_vec::iterator iter = all_tiles.begin(); @@ -375,6 +379,7 @@ command_result df_liquids_execute(color_ostream &out) mcache.setTemp2At(*iter,10015); df::tile_designation des = mcache.designationAt(*iter); des.bits.flow_size = 0; + des.bits.flow_forbid = false; mcache.setDesignationAt(*iter, des); iter ++; } @@ -481,6 +486,9 @@ command_result df_liquids_execute(color_ostream &out) mcache.setTemp1At(current,10015); mcache.setTemp2At(current,10015); } + // mark the tile passable or impassable like the game does + des.bits.flow_forbid = des.bits.flow_size && + (des.bits.liquid_type == tile_liquid::Magma || des.bits.flow_size > 3); mcache.setDesignationAt(current,des); } seen_blocks.insert(mcache.BlockAt(current / 16)); |
