mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-01-09 22:37:07 +00:00
Fix incorrect kick out of rebuilds (#1120)
This commit is contained in:
parent
952786c166
commit
208ed02158
@ -180,7 +180,7 @@ void RebuildComponent::Update(float deltaTime) {
|
|||||||
{
|
{
|
||||||
Entity* builder = GetBuilder();
|
Entity* builder = GetBuilder();
|
||||||
|
|
||||||
if (builder == nullptr) {
|
if (!builder) {
|
||||||
ResetRebuild(false);
|
ResetRebuild(false);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -198,16 +198,16 @@ void RebuildComponent::Update(float deltaTime) {
|
|||||||
if (!destComp) break;
|
if (!destComp) break;
|
||||||
|
|
||||||
int newImagination = destComp->GetImagination();
|
int newImagination = destComp->GetImagination();
|
||||||
if (newImagination <= 0) {
|
|
||||||
CancelRebuild(builder, eQuickBuildFailReason::OUT_OF_IMAGINATION, true);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
++m_DrainedImagination;
|
++m_DrainedImagination;
|
||||||
--newImagination;
|
--newImagination;
|
||||||
destComp->SetImagination(newImagination);
|
destComp->SetImagination(newImagination);
|
||||||
Game::entityManager->SerializeEntity(builder);
|
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);
|
if (missionComponent) missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else{
|
} else {
|
||||||
auto* missionComponent = builder->GetComponent<MissionComponent>();
|
auto* missionComponent = builder->GetComponent<MissionComponent>();
|
||||||
if (missionComponent) missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityId);
|
if (missionComponent) missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityId);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user