Make liquids and tiletypes force rebuild of pathfinding data.

develop
Alexander Gavrilov 2012-04-25 18:38:43 +04:00
parent 1cd802d426
commit 23a0b17ff3
2 changed files with 7 additions and 0 deletions

@ -374,6 +374,10 @@ command_result df_liquids_execute(color_ostream &out)
DFHack::DFCoord cursor(x,y,z); DFHack::DFCoord cursor(x,y,z);
coord_vec all_tiles = brush->points(mcache,cursor); coord_vec all_tiles = brush->points(mcache,cursor);
out << "working..." << endl; out << "working..." << endl;
// Force the game to recompute its walkability cache
df::global::world->reindex_pathfinding = true;
if(mode == "obsidian") if(mode == "obsidian")
{ {
coord_vec::iterator iter = all_tiles.begin(); coord_vec::iterator iter = all_tiles.begin();

@ -614,6 +614,9 @@ command_result executePaintJob(color_ostream &out)
coord_vec all_tiles = brush->points(map, cursor); coord_vec all_tiles = brush->points(map, cursor);
out.print("working...\n"); out.print("working...\n");
// Force the game to recompute its walkability cache
df::global::world->reindex_pathfinding = true;
for (coord_vec::iterator iter = all_tiles.begin(); iter != all_tiles.end(); ++iter) for (coord_vec::iterator iter = all_tiles.begin(); iter != all_tiles.end(); ++iter)
{ {
const df::tiletype source = map.tiletypeAt(*iter); const df::tiletype source = map.tiletypeAt(*iter);