Skip to content

Commit

Permalink
reduce traffic greatly
Browse files Browse the repository at this point in the history
  • Loading branch information
EmosewaMC committed Jan 14, 2025
1 parent c968dc9 commit b738504
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions dGame/dComponents/QuickBuildComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,10 @@ void QuickBuildComponent::Update(float deltaTime) {

if (isSmashGroup) {
ModifyIncompleteTimer(deltaTime);
Game::entityManager->SerializeEntity(m_Parent);

// For reset times < 0 this has to be handled manually
if (m_TimeBeforeSmash > 0) {
if (m_TimerIncomplete >= m_TimeBeforeSmash - 4.0f) {
if (m_TimerIncomplete >= m_TimeBeforeSmash - 4.0f && !m_ShowResetEffect) {
SetShowResetEffect(true);

Game::entityManager->SerializeEntity(m_Parent);
Expand All @@ -149,11 +148,10 @@ void QuickBuildComponent::Update(float deltaTime) {
}
case eQuickBuildState::COMPLETED: {
ModifyTimer(deltaTime);
Game::entityManager->SerializeEntity(m_Parent);

// For reset times < 0 this has to be handled manually
if (m_ResetTime > 0) {
if (m_Timer >= m_ResetTime - 4.0f) {
if (m_Timer >= m_ResetTime - 4.0f && !m_ShowResetEffect) {
SetShowResetEffect(true);

Game::entityManager->SerializeEntity(m_Parent);
Expand Down Expand Up @@ -210,11 +208,10 @@ void QuickBuildComponent::Update(float deltaTime) {
}
case eQuickBuildState::INCOMPLETE: {
ModifyIncompleteTimer(deltaTime);
Game::entityManager->SerializeEntity(m_Parent);

// For reset times < 0 this has to be handled manually
if (m_TimeBeforeSmash > 0) {
if (m_TimerIncomplete >= m_TimeBeforeSmash - 4.0f) {
if (m_TimerIncomplete >= m_TimeBeforeSmash - 4.0f && !m_ShowResetEffect) {
SetShowResetEffect(true);

Game::entityManager->SerializeEntity(m_Parent);
Expand Down

0 comments on commit b738504

Please sign in to comment.