Closed Bumber64 closed 4 weeks ago
don't mind the compilation failures. they'll clear up once https://github.com/DFHack/dfhack/pull/4631 is merged
ok, now the build errors are real
ok, now the build errors are real
this PR depends on #4591 for the use of std::vector<int32_t>
in a lua call from a plugin
Should regrass
be given the plants
tag? The tag definition doesn't specify grass, but a user might expect grass to be included.
Should
regrass
be given theplants
tag? The tag definition doesn't specify grass, but a user might expect grass to be included.
yes, that sounds reasonable
editor's note: final punctuation goes outside of enclosing parentheses unless the entire sentence is inside the parentheses.
U.S. English built different.
editor's note: final punctuation goes outside of enclosing parentheses unless the entire sentence is inside the parentheses.
U.S. English built different.
I'm going by https://www.thepunctuationguide.com/parentheses.html (but of course only because that's the way I already write..)
editor's note: final punctuation goes outside of enclosing parentheses unless the entire sentence is inside the parentheses.
U.S. English built different.
Not according to my legal writing instructor (at a US-based law school).
i am working on an PR that adds identity support for std::vector<int32_t>
and std::vector<int16_t>
in order to make this mergeable
I'll merge in the following diff to adjust to structure changes:
diff --git a/plugins/plants.cpp b/plugins/plants.cpp
index 2325c01e3..8de7ccc6f 100644
--- a/plugins/plants.cpp
+++ b/plugins/plants.cpp
@@ -69,7 +69,8 @@ command_result df_grow (color_ostream &out, vector <string> & parameters)
{
df::plant *p = world->plants.all[i];
df::tiletype ttype = map.tiletypeAt(df::coord(p->pos.x,p->pos.y,p->pos.z));
- if(!p->flags.bits.is_shrub && tileShape(ttype) == tiletype_shape::SAPLING && tileSpecial(ttype) != tiletype_special::DEAD)
+ bool is_shrub = plant->type == df::plant_type::DRY_PLANT || plant->type == df::plant_type::WET_PLANT;
+ if(!is_shrub && tileShape(ttype) == tiletype_shape::SAPLING && tileSpecial(ttype) != tiletype_special::DEAD)
{
p->grow_counter = sapling_to_tree_threshold;
grown++;
@@ -148,12 +149,12 @@ command_result df_createplant (color_ostream &out, vector <string> & parameters)
else
{
plant->hitpoints = 100000;
- plant->flags.bits.is_shrub = 1;
+ plant->type = df::plant_type::DRY_PLANT;
}
- // for now, always set "watery" for WET-permitted plants, even if they're spawned away from water
+ // for now, assume wet for WET-permitted plants, even if they're spawned away from water
// the proper method would be to actually look for nearby water features, but it's not clear exactly how that works
- if (plant_raw->flags.is_set(plant_raw_flags::WET))
- plant->type = df::plant_type::WET_TREE;
+ if (plant_raw->flags.is_set(plant_raw_flags::WET)) {
+ if (plant_raw->flags.is_set(plant_raw_flags::TREE))
+ plant->type = df::plant_type::WET_TREE;
+ else
+ plant->type = df::plant_type::WET_PLANT;
+ }
plant->material = plant_id;
plant->pos.x = x;
plant->pos.y = y;
@@ -169,7 +170,7 @@ command_result df_createplant (color_ostream &out, vector <string> & parameters)
case 3: world->plants.shrub_wet.push_back(plant); break;
}
col->plants.push_back(plant);
- if (plant->flags.bits.is_shrub)
+ if (plant->type == df::plant_type::DRY_PLANT || plant->type == df::plant_type::WET_PLANT)
map->tiletype[tx][ty] = tiletype::Shrub;
else
map->tiletype[tx][ty] = tiletype::Sapling;
Rename the
plants
plugin toplant
to match the command, making it easier to find docs.Add command
plant remove
to remove plants. (Doesn't work on mature trees yet. Will need to reverse-engineer proper tile removal at a later date.) Addplant list
to list shrub and sapling raw IDs, avoiding use of lengthydevel/query
command and excluding grasses.Adds a bunch of options to existing
plant create
andplant grow
. See:docs/plugins/plant.rst
. Use proper logic for determining plantwatery
flag, adding to wet/dry vector.Minor improvement to
regrass
to accept numerical raw ID for grass type.regrass --list
replacesregrass --plant ""
. Don't remove mud on regrass (since DF doesn't.)plants
doc tag now encompasses tools that affect grass, to includeregrass
plugin.plant
uses its owncuboid
struct. This can be replaced by a more global one: #4595