From 2d19514fbc3c0a31f0aa96c4db3380767271e514 Mon Sep 17 00:00:00 2001 From: Robert Heinrich Date: Sat, 21 Apr 2012 11:52:03 +0200 Subject: [PATCH 1/3] probe: minor change --- plugins/probe.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/plugins/probe.cpp b/plugins/probe.cpp index 4e041f180..6524bd06b 100644 --- a/plugins/probe.cpp +++ b/plugins/probe.cpp @@ -383,14 +383,10 @@ command_result df_bprobe (color_ostream &out, vector & parameters) break; } if(building.origin->is_room) //isRoom()) - out << ", is room"; - else - out << ", not a room"; + out << ", room"; if(building.origin->getBuildStage()!=building.origin->getMaxBuildStage()) out << ", in construction"; out.print("\n"); - - } return CR_OK; } From 760bc8b09f55413873a611a5c5f86344476f479a Mon Sep 17 00:00:00 2001 From: Robert Heinrich Date: Sun, 22 Apr 2012 20:25:10 +0200 Subject: [PATCH 2/3] regrass: ignore furrowed tiles (dirt roads) --- plugins/regrass.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/regrass.cpp b/plugins/regrass.cpp index dec091a92..64aa3a472 100644 --- a/plugins/regrass.cpp +++ b/plugins/regrass.cpp @@ -86,6 +86,10 @@ command_result df_regrass (color_ostream &out, vector & parameters) || cur->occupancy[x][y].bits.building) continue; + // don't touch furrowed tiles (dirt roads made on soil) + if(tileSpecial(cur->tiletype[x][y]) == tiletype_special::FURROWED) + continue; + int mat = tileMaterial(cur->tiletype[x][y]); if ( mat != tiletype_material::SOIL && mat != tiletype_material::GRASS_DARK // refill existing grass, too @@ -93,6 +97,7 @@ command_result df_regrass (color_ostream &out, vector & parameters) ) continue; + // max = set amounts of all grass events on that tile to 100 if(max) { From e1770fa62bebf1fe3fc4af7a6dbd9c7260b51c6e Mon Sep 17 00:00:00 2001 From: Robert Heinrich Date: Mon, 23 Apr 2012 00:34:19 +0200 Subject: [PATCH 3/3] regrass: leaves tiles with the no_grow flag alone (avoids regrassing roads etc you embark on) --- plugins/probe.cpp | 33 +++++++++++++++++++++++++++++++++ plugins/regrass.cpp | 3 ++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/plugins/probe.cpp b/plugins/probe.cpp index b3b288374..4c8179e52 100644 --- a/plugins/probe.cpp +++ b/plugins/probe.cpp @@ -314,6 +314,39 @@ command_result df_probe (color_ostream &out, vector & parameters) out << "global feature idx: " << block.global_feature << endl; out << std::endl; + + if(block.occupancy[tileX][tileY].bits.no_grow) + out << "no grow" << endl; + + for(size_t e=0; egetType(); + switch(blevtype) + { + case df::block_square_event_type::grass: + { + df::block_square_event_grassst * gr_ev = (df::block_square_event_grassst *)blev; + if(gr_ev->amount[tileX][tileY] > 0) + { + out << "amount of grass: " << (int)gr_ev->amount[tileX][tileY] << endl; + } + break; + } + case df::block_square_event_type::world_construction: + { + df::block_square_event_world_constructionst * co_ev = (df::block_square_event_world_constructionst*)blev; + uint16_t bits = co_ev->tile_bitmask[tileY]; + out << "construction bits: " << bits << endl; + break; + } + default: + //out << "unhandled block event type!" << endl; + break; + } + } + + return CR_OK; } diff --git a/plugins/regrass.cpp b/plugins/regrass.cpp index 64aa3a472..5475862ae 100644 --- a/plugins/regrass.cpp +++ b/plugins/regrass.cpp @@ -83,7 +83,8 @@ command_result df_regrass (color_ostream &out, vector & parameters) { if ( tileShape(cur->tiletype[x][y]) != tiletype_shape::FLOOR || cur->designation[x][y].bits.subterranean - || cur->occupancy[x][y].bits.building) + || cur->occupancy[x][y].bits.building + || cur->occupancy[x][y].bits.no_grow) continue; // don't touch furrowed tiles (dirt roads made on soil)