mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-22 21:43:35 +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();
|
||||
|
||||
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<MissionComponent>();
|
||||
if (missionComponent) missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityId);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user