From 3c9c65fa381af68bebbc669e33bbef6f6a59b6d1 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Sun, 25 Aug 2024 20:29:22 +1000 Subject: [PATCH] fix sapling infinite loop --- source/game/objects/StarFarmableObject.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/game/objects/StarFarmableObject.cpp b/source/game/objects/StarFarmableObject.cpp index cfb550d..8b8f617 100644 --- a/source/game/objects/StarFarmableObject.cpp +++ b/source/game/objects/StarFarmableObject.cpp @@ -42,8 +42,13 @@ void FarmableObject::update(float dt, uint64_t currentStep) { 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); + if (m_stage == lastStage) + break; + } // update immersion and check whether farmable should break m_immersion.update(bind(&Object::liquidFillLevel, this));