fix: fv mpc in the tree (#2010)

tested that it now spawns in the lower path point instead.

fixes #741
This commit is contained in:
David Markowitz
2026-06-20 16:53:49 -07:00
committed by GitHub
parent ccad52a5ce
commit ccc029424c
3 changed files with 19 additions and 15 deletions

View File

@@ -613,14 +613,15 @@ void Entity::Initialize() {
if (rebuildResetTime != 0.0f) { if (rebuildResetTime != 0.0f) {
quickBuildComponent->SetResetTime(rebuildResetTime); quickBuildComponent->SetResetTime(rebuildResetTime);
// Known bug with moving platform in FV that casues it to build at the end instead of the start.
// This extends the smash time so players can ride up the lift.
if (m_TemplateID == 9483) {
quickBuildComponent->SetResetTime(quickBuildComponent->GetResetTime() + 25);
}
} }
const auto objectID = GetObjectID();
// FV tree handler for when built so it sets the state to moving at the correct time
if (GetLOT() == 9483) quickBuildComponent->AddQuickBuildCompleteCallback([objectID](Entity* user) {
auto* const entity = Game::entityManager->GetEntity(objectID);
if (entity) GameMessages::SendPlatformResync(entity, UNASSIGNED_SYSTEM_ADDRESS, false, 0, 1, 1, eMovementPlatformState::Moving, true);
});
const auto activityID = GetVar<int32_t>(u"activityID"); const auto activityID = GetVar<int32_t>(u"activityID");
if (activityID > 0) { if (activityID > 0) {
@@ -1616,7 +1617,7 @@ void Entity::Kill(Entity* murderer, const eKillType killType) {
const auto& grpNameQBShowBricks = GetVarAsString(u"grpNameQBShowBricks"); const auto& grpNameQBShowBricks = GetVarAsString(u"grpNameQBShowBricks");
if (!grpNameQBShowBricks.empty()) { if (!grpNameQBShowBricks.empty()) {
for (auto* const spawner : Game::zoneManager->GetSpawnersByName(grpNameQBShowBricks)) if (spawner) spawner->Spawn(); for (auto* const spawner : Game::zoneManager->GetSpawnersByName(grpNameQBShowBricks)) if (spawner) spawner->Spawn();
for (auto* const spawner : Game::zoneManager->GetSpawnersInGroup(grpNameQBShowBricks)) if (spawner) spawner->Spawn(); for (auto* const spawner : Game::zoneManager->GetSpawnersInGroup(grpNameQBShowBricks)) if (spawner) spawner->Spawn();
} }

View File

@@ -366,18 +366,19 @@ void GameMessages::SendResetMissions(Entity* entity, const SystemAddress& sysAdd
void GameMessages::SendPlatformResync(Entity* entity, const SystemAddress& sysAddr, bool bStopAtDesiredWaypoint, void GameMessages::SendPlatformResync(Entity* entity, const SystemAddress& sysAddr, bool bStopAtDesiredWaypoint,
int iIndex, int iDesiredWaypointIndex, int nextIndex, int iIndex, int iDesiredWaypointIndex, int nextIndex,
eMovementPlatformState movementState) { eMovementPlatformState movementState, bool special) {
CBITSTREAM; CBITSTREAM;
CMSGHEADER; CMSGHEADER;
const auto objID = entity->GetObjectID();
const auto lot = entity->GetLOT(); const auto lot = entity->GetLOT();
if (lot == 12341 || lot == 5027 || lot == 5028 || lot == 14335 || lot == 14447 || lot == 14449 || lot == 11306 || lot == 11308) { if (lot == 12341 || lot == 5027 || lot == 5028 || lot == 14335 || lot == 14447 || lot == 14449 || lot == 11306 || lot == 11308 || lot == 9483) {
iDesiredWaypointIndex = (lot == 11306 || lot == 11308) ? 1 : 0; iDesiredWaypointIndex = (lot == 11306 || lot == 11308) ? 1 : 0;
iIndex = 0; iIndex = lot == 9483 ? 1 : 0;
nextIndex = 0; nextIndex = lot == 9483 && !special ? 1 : 0;
bStopAtDesiredWaypoint = true; bStopAtDesiredWaypoint = true;
movementState = eMovementPlatformState::Stationary; movementState = lot == 9483 && !special ? eMovementPlatformState::Stopped : eMovementPlatformState::Stationary;
} }
bitStream.Write(entity->GetObjectID()); bitStream.Write(entity->GetObjectID());

View File

@@ -103,9 +103,11 @@ namespace GameMessages {
void SendPlayNDAudioEmitter(Entity* entity, const SystemAddress& sysAddr, std::string audioGUID); void SendPlayNDAudioEmitter(Entity* entity, const SystemAddress& sysAddr, std::string audioGUID);
void SendStartPathing(Entity* entity); void SendStartPathing(Entity* entity);
// special is for the FV tree platform, feature is complete if we just do that so meh
void SendPlatformResync(Entity* entity, const SystemAddress& sysAddr, bool bStopAtDesiredWaypoint = false, void SendPlatformResync(Entity* entity, const SystemAddress& sysAddr, bool bStopAtDesiredWaypoint = false,
int iIndex = 0, int iDesiredWaypointIndex = 1, int nextIndex = 1, int iIndex = 0, int iDesiredWaypointIndex = 1, int nextIndex = 1,
eMovementPlatformState movementState = eMovementPlatformState::Moving); eMovementPlatformState movementState = eMovementPlatformState::Moving, bool special = false);
void SendResetMissions(Entity* entity, const SystemAddress& sysAddr, const int32_t missionid = -1); void SendResetMissions(Entity* entity, const SystemAddress& sysAddr, const int32_t missionid = -1);
void SendRestoreToPostLoadStats(Entity* entity, const SystemAddress& sysAddr); void SendRestoreToPostLoadStats(Entity* entity, const SystemAddress& sysAddr);