squashed commit

This commit is contained in:
jadebenn
2023-12-17 04:02:32 -06:00
parent a9ca0198b0
commit e4d423be5e
7 changed files with 54 additions and 49 deletions

View File

@@ -197,18 +197,17 @@ void RebuildComponent::Update(float deltaTime) {
DestroyableComponent* destComp = builder->GetComponent<DestroyableComponent>();
if (!destComp) break;
int newImagination = destComp->GetImagination();
++m_DrainedImagination;
--newImagination;
const int32_t imaginationCostRemaining = m_TakeImagination - m_DrainedImagination;
const int32_t newImagination = destComp->GetImagination() - 1;
destComp->SetImagination(newImagination);
Game::entityManager->SerializeEntity(builder);
if (newImagination <= 0) {
if (newImagination <= 0 && imaginationCostRemaining > 0) {
CancelRebuild(builder, eQuickBuildFailReason::OUT_OF_IMAGINATION, true);
break;
}
}
if (m_Timer >= m_CompleteTime && m_DrainedImagination >= m_TakeImagination) {

View File

@@ -285,7 +285,7 @@ private:
float m_CompleteTime = 0;
/**
* The imagination that's deducted when compeleting the rebuild
* The imagination that's deducted when completing the rebuild
*/
int m_TakeImagination = 0;

View File

@@ -38,8 +38,6 @@
#include "ePlayerFlag.h"
#include "dConfig.h"
using namespace std;
void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const SystemAddress& sysAddr, LWOOBJID objectID, eGameMessageType messageID) {
CBITSTREAM;

View File

@@ -2,5 +2,6 @@
#include <map>
#include "eGameMessageType.h"
#include "eWorldMessageType.h"
#undef GENERATE_ENUM_STRINGS // Stop string generation
#undef GENERATE_ENUM_STRINGS // Stop string generation