From 707880b5fc4c6871af8652ad2f552e06822ed903 Mon Sep 17 00:00:00 2001 From: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> Date: Thu, 11 Jun 2026 07:12:06 -0700 Subject: [PATCH] fix: fv pipe quick build not spawning as it should (#1991) tested that the pipe now spawns a ROCK that you can build. This ROCK you build spawns the PIPE now. new bug: if you start building the ROCK and stop, the pipe will spawn instead of the previous rock. --- dGame/Entity.cpp | 3 +-- dGame/dComponents/QuickBuildComponent.cpp | 30 +++++++++++++++++++++++ dGame/dComponents/QuickBuildComponent.h | 2 ++ dZoneManager/Spawner.cpp | 3 ++- 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/dGame/Entity.cpp b/dGame/Entity.cpp index 5dde43e5..d88aa1d5 100644 --- a/dGame/Entity.cpp +++ b/dGame/Entity.cpp @@ -1613,8 +1613,7 @@ void Entity::Kill(Entity* murderer, const eKillType killType) { else Game::entityManager->DestroyEntity(this); } - const auto& grpNameQBShowBricks = GetVar(u"grpNameQBShowBricks"); - + const auto& grpNameQBShowBricks = GetVarAsString(u"grpNameQBShowBricks"); if (!grpNameQBShowBricks.empty()) { auto spawners = Game::zoneManager->GetSpawnersByName(grpNameQBShowBricks); diff --git a/dGame/dComponents/QuickBuildComponent.cpp b/dGame/dComponents/QuickBuildComponent.cpp index 0940d19d..52b2ddee 100644 --- a/dGame/dComponents/QuickBuildComponent.cpp +++ b/dGame/dComponents/QuickBuildComponent.cpp @@ -22,6 +22,8 @@ #include "RenderComponent.h" #include "CppScripts.h" +#include "StringifiedEnum.h" +#include "Amf3.h" QuickBuildComponent::QuickBuildComponent(Entity* const entity, const int32_t componentID) : Component{ entity, componentID } { std::u16string checkPreconditions = entity->GetVar(u"CheckPrecondition"); @@ -42,6 +44,7 @@ QuickBuildComponent::QuickBuildComponent(Entity* const entity, const int32_t com } SpawnActivator(); + RegisterMsg(&QuickBuildComponent::OnGetObjectReportInfo); } QuickBuildComponent::~QuickBuildComponent() { @@ -568,3 +571,30 @@ void QuickBuildComponent::AddQuickBuildCompleteCallback(const std::function& callback) { m_QuickBuildStateCallbacks.push_back(callback); } + +bool QuickBuildComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportInfo) { + auto& quickbuild = reportInfo.info->PushDebug("Quick Build"); + quickbuild.PushDebug("State") = StringifiedEnum::ToString(m_State).data(); + quickbuild.PushDebug("Timer") = m_Timer; + quickbuild.PushDebug("TimerIncomplete") = m_TimerIncomplete; + quickbuild.PushDebug("ActivatorPosition").PushDebug(m_ActivatorPosition); + quickbuild.PushDebug("ActivatorId") = std::to_string(m_ActivatorId); + quickbuild.PushDebug("ShowResetEffect") = m_ShowResetEffect; + quickbuild.PushDebug("Taken") = m_Taken; + quickbuild.PushDebug("ResetTime") = m_ResetTime; + quickbuild.PushDebug("CompleteTime") = m_CompleteTime; + quickbuild.PushDebug("TakeImagination") = m_TakeImagination; + quickbuild.PushDebug("Interruptible") = m_Interruptible; + quickbuild.PushDebug("SelfActivator") = m_SelfActivator; + auto& modules = quickbuild.PushDebug("CustomModules"); + for (const auto cmodule : m_CustomModules) modules.PushDebug("Module") = cmodule; + quickbuild.PushDebug("ActivityId") = m_ActivityId; + quickbuild.PushDebug("PostImaginationCost") = m_PostImaginationCost; + quickbuild.PushDebug("TimeBeforeSmash") = m_TimeBeforeSmash; + quickbuild.PushDebug("TimeBeforeDrain") = m_TimeBeforeDrain; + quickbuild.PushDebug("DrainedImagination") = m_DrainedImagination; + quickbuild.PushDebug("RepositionPlayer") = m_RepositionPlayer; + quickbuild.PushDebug("SoftTimer") = m_SoftTimer; + quickbuild.PushDebug("Builder") = std::to_string(m_Builder); + return true; +} diff --git a/dGame/dComponents/QuickBuildComponent.h b/dGame/dComponents/QuickBuildComponent.h index 8f5f1773..4a3b9ef8 100644 --- a/dGame/dComponents/QuickBuildComponent.h +++ b/dGame/dComponents/QuickBuildComponent.h @@ -261,6 +261,8 @@ public: m_StateDirty = true; } private: + + bool OnGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportInfo); /** * Whether or not the quickbuild state has been changed since we last serialized it. */ diff --git a/dZoneManager/Spawner.cpp b/dZoneManager/Spawner.cpp index df966055..cccdfff0 100644 --- a/dZoneManager/Spawner.cpp +++ b/dZoneManager/Spawner.cpp @@ -55,7 +55,8 @@ Spawner::Spawner(const SpawnerInfo info) { m_SpawnSmashFoundGroup = true; m_SpawnOnSmashID = ssSpawner ? ssSpawner->m_Info.spawnerID : LWOOBJID_EMPTY; ssSpawner->AddSpawnedEntityDieCallback([=, this]() { - Spawn(); + // Intentionally left as a non debug log since i have no idea how much stuff this would affect + LOG("WOULD HAVE SPAWNED %i", m_EntityInfo.lot); }); } }