fix sapling infinite loop

This commit is contained in:
Kae 2024-08-25 20:29:22 +10:00
parent e3462c3c69
commit 3c9c65fa38

View File

@ -42,8 +42,13 @@ void FarmableObject::update(float dt, uint64_t currentStep) {
enterStage(m_stage); enterStage(m_stage);
} }
while (!m_finalStage && world()->epochTime() >= m_nextStageTime)
while (!m_finalStage && world()->epochTime() >= m_nextStageTime) {
int lastStage = m_stage;
enterStage(m_stage + 1); enterStage(m_stage + 1);
if (m_stage == lastStage)
break;
}
// update immersion and check whether farmable should break // update immersion and check whether farmable should break
m_immersion.update(bind(&Object::liquidFillLevel, this)); m_immersion.update(bind(&Object::liquidFillLevel, this));