mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-01-09 14:27:10 +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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user