Skip to content

Commit da108ee

Browse files
authored
Update Maps.h - isPlantInBox
1 parent 96ab31d commit da108ee

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

library/include/modules/Maps.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,10 @@ DFHACK_EXPORT bool canStepBetween(df::coord pos1, df::coord pos2);
382382
// Get the plant that owns the tile at the specified position.
383383
extern DFHACK_EXPORT df::plant *getPlantAtTile(int32_t x, int32_t y, int32_t z);
384384
inline df::plant *getPlantAtTile(df::coord pos) { return getPlantAtTile(pos.x, pos.y, pos.z); }
385+
// Returns true if the plant is within a box defined by the specified coordinates, accounting for trees.
386+
DFHACK_EXPORT bool isPlantInBox(df::plant *plant, const cuboid &bounds);
387+
inline bool isPlantInBox(df::plant *plant, int16_t x1, int16_t y1, int16_t z1,
388+
int16_t x2, int16_t y2, int16_t z2) { return isPlantInBox(plant, cuboid(x1, y1, z1, x2, y2, z2)); }
385389

386390
// Get the biome type at the given region coordinates.
387391
DFHACK_EXPORT df::enums::biome_type::biome_type getBiomeTypeWithRef(int16_t region_x, int16_t region_y, int16_t region_ref_y);

0 commit comments

Comments
 (0)