fix bush insta-grow

This commit is contained in:
darkrose 2017-06-29 14:40:04 +10:00
parent 389fd92012
commit 399aa5f3cc
2 changed files with 6 additions and 2 deletions

View File

@ -745,7 +745,7 @@ public:
private:
Inventory *m_inventory;
u16 m_days_since_growth;
s16 m_days_since_growth;
};
class CircuitNodeMetadata : public NodeMetadata

View File

@ -423,7 +423,7 @@ BushNodeMetadata::BushNodeMetadata()
m_inventory = new Inventory();
m_inventory->addList("main", 1);
m_days_since_growth = 0;
m_days_since_growth = -1;
}
BushNodeMetadata::~BushNodeMetadata()
{
@ -462,6 +462,10 @@ bool BushNodeMetadata::step(float dtime, v3s16 pos, ServerEnvironment *env)
if (env->getSeason() != ENV_SEASON_SPRING)
return false;
u32 day = env->getTime();
if (m_days_since_growth < 0) {
m_days_since_growth = day;
return true;
}
if (day-m_days_since_growth < 10) {
return true;
}