diff --git a/dGame/dComponents/QuickBuildComponent.cpp b/dGame/dComponents/QuickBuildComponent.cpp index 698750596..70c4a2ad4 100644 --- a/dGame/dComponents/QuickBuildComponent.cpp +++ b/dGame/dComponents/QuickBuildComponent.cpp @@ -448,7 +448,6 @@ void QuickBuildComponent::CompleteQuickBuild(Entity* const user) { auto* characterComponent = user->GetComponent(); if (characterComponent != nullptr) { characterComponent->SetCurrentActivity(eGameActivity::NONE); - characterComponent->TrackQuickBuildComplete(); EconomyLedger::RecordMapEvent(IEconomyLedger::eMapEvent::QUICKBUILDS_COMPLETED, m_Parent->GetLOT(), m_Parent->GetPosition(), 1, user); } else { LOG("Some user tried to finish the rebuild but they didn't have a character somehow."); @@ -466,6 +465,8 @@ void QuickBuildComponent::CompleteQuickBuild(Entity* const user) { GameMessages::PlayFXEffect fx(m_Parent->GetObjectID(), 507, u"create", "BrickFadeUpVisCompleteEffect"); fx.priority = 0.4f; fx.Send(UNASSIGNED_SYSTEM_ADDRESS); + // Live: RebuildNotifyState(Completed), the effect, then QuickBuildsCompleted, then EnableRebuild + characterComponent->TrackQuickBuildComplete(); GameMessages::EnableRebuild enableRebuild; enableRebuild.target = m_Parent->GetObjectID(); enableRebuild.bEnable = false; diff --git a/dGame/dComponents/RocketLaunchpadControlComponent.cpp b/dGame/dComponents/RocketLaunchpadControlComponent.cpp index 73243c80b..6a0beec72 100644 --- a/dGame/dComponents/RocketLaunchpadControlComponent.cpp +++ b/dGame/dComponents/RocketLaunchpadControlComponent.cpp @@ -74,8 +74,6 @@ void RocketLaunchpadControlComponent::Launch(Entity* originator, LWOMAPID mapId, character->SetTargetScene(m_TargetScene); } - characterComponent->UpdatePlayerStatistic(RocketsUsed); - character->SaveXMLToDatabase(); SetSelectedMapId(originator->GetObjectID(), zone); diff --git a/dGame/dGameMessages/ObjectMessages.cpp b/dGame/dGameMessages/ObjectMessages.cpp index 93c976f5a..62ac10ccb 100644 --- a/dGame/dGameMessages/ObjectMessages.cpp +++ b/dGame/dGameMessages/ObjectMessages.cpp @@ -97,6 +97,10 @@ namespace GameMessages { return; } + // Live counted the rocket when the client asked to go (after the launch), before TransferToZone + auto* launcher = player->GetComponent(); + if (launcher) launcher->UpdatePlayerStatistic(RocketsUsed); + ZoneInstanceManager::Instance()->RequestZoneTransfer(Game::server, mapId, cloneId, false, [=](bool mythranShift, uint32_t zoneID, uint32_t zoneInstance, uint32_t zoneClone, std::string serverIP, uint16_t serverPort) { LOG("Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i", character->GetName().c_str(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);