From 208ed021582f9cb37c2c028900163230586886ea Mon Sep 17 00:00:00 2001 From: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> Date: Thu, 3 Aug 2023 19:37:27 -0700 Subject: [PATCH] Fix incorrect kick out of rebuilds (#1120) --- dGame/dComponents/RebuildComponent.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dGame/dComponents/RebuildComponent.cpp b/dGame/dComponents/RebuildComponent.cpp index 13854bd6..e669489d 100644 --- a/dGame/dComponents/RebuildComponent.cpp +++ b/dGame/dComponents/RebuildComponent.cpp @@ -180,7 +180,7 @@ void RebuildComponent::Update(float deltaTime) { { Entity* builder = GetBuilder(); - if (builder == nullptr) { + if (!builder) { ResetRebuild(false); return; @@ -198,16 +198,16 @@ void RebuildComponent::Update(float deltaTime) { if (!destComp) break; int newImagination = destComp->GetImagination(); - if (newImagination <= 0) { - CancelRebuild(builder, eQuickBuildFailReason::OUT_OF_IMAGINATION, true); - break; - } ++m_DrainedImagination; --newImagination; destComp->SetImagination(newImagination); Game::entityManager->SerializeEntity(builder); + if (newImagination <= 0) { + CancelRebuild(builder, eQuickBuildFailReason::OUT_OF_IMAGINATION, true); + break; + } } @@ -482,7 +482,7 @@ void RebuildComponent::CompleteRebuild(Entity* user) { if (missionComponent) missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityId); } } - } else{ + } else { auto* missionComponent = builder->GetComponent(); if (missionComponent) missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityId); }