summaryrefslogtreecommitdiff
path: root/plugins/plants.cpp
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-04-11 12:01:27 +0400
committerAlexander Gavrilov2012-04-11 12:01:27 +0400
commitc7b922250b5e41cb78b8636a706fdc07be615974 (patch)
tree2264c4993db36afae51853307505c7572017bf82 /plugins/plants.cpp
parent59ddbfacb70a8f56e3fa2088ada1df71d8d158de (diff)
downloaddfhack-c7b922250b5e41cb78b8636a706fdc07be615974.tar.gz
dfhack-c7b922250b5e41cb78b8636a706fdc07be615974.tar.bz2
dfhack-c7b922250b5e41cb78b8636a706fdc07be615974.tar.xz
More maps api refactoring and renaming.
getBlockAbs is a very confusing name; getTileBlock is better.
Diffstat (limited to 'plugins/plants.cpp')
-rw-r--r--plugins/plants.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/plants.cpp b/plugins/plants.cpp
index 09220c65..5ab09868 100644
--- a/plugins/plants.cpp
+++ b/plugins/plants.cpp
@@ -125,8 +125,9 @@ static command_result immolations (color_ostream &out, do_what what, bool shrubs
int32_t x,y,z;
if(Gui::getCursorCoords(x,y,z))
{
- vector<df::plant *> * alltrees;
- if(Maps::ReadVegetation(x/16,y/16,z,alltrees))
+ auto block = Maps::getTileBlock(x,y,z);
+ vector<df::plant *> *alltrees = block ? &block->plants : NULL;
+ if(alltrees)
{
bool didit = false;
for(size_t i = 0 ; i < alltrees->size(); i++)
@@ -206,8 +207,9 @@ command_result df_grow (color_ostream &out, vector <string> & parameters)
int32_t x,y,z;
if(Gui::getCursorCoords(x,y,z))
{
- vector<df::plant *> * alltrees;
- if(Maps::ReadVegetation(x/16,y/16,z,alltrees))
+ auto block = Maps::getTileBlock(x,y,z);
+ vector<df::plant *> *alltrees = block ? &block->plants : NULL;
+ if(alltrees)
{
for(size_t i = 0 ; i < alltrees->size(); i++)
{