From f59ca8b1da3bfb61b857136464e435b6bb9b7335 Mon Sep 17 00:00:00 2001 From: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> Date: Wed, 15 Nov 2023 17:32:17 -0800 Subject: [PATCH] fix: Ugc model pickup (#1275) * Ugc: Make it so we dont bin the model Users must dismantle the model as opposed to accidentally picking it up in model mode * Fix editing model in brick mode * PropEntrance: Remove debug log --- .../PropertyManagementComponent.cpp | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/dGame/dComponents/PropertyManagementComponent.cpp b/dGame/dComponents/PropertyManagementComponent.cpp index 63c321f6..1fc38119 100644 --- a/dGame/dComponents/PropertyManagementComponent.cpp +++ b/dGame/dComponents/PropertyManagementComponent.cpp @@ -423,6 +423,25 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet return; } + auto* model = Game::entityManager->GetEntity(id); + + if (model == nullptr) { + LOG("Failed to find model entity"); + + return; + } + + if (model->GetLOT() == 14 && deleteReason == 0) { + LOG("User is trying to pick up a BBB model, but this is not implemented, so we return to prevent the user from losing the model"); + + GameMessages::SendUGCEquipPostDeleteBasedOnEditMode(entity->GetObjectID(), entity->GetSystemAddress(), LWOOBJID_EMPTY, 0); + + // Need this to pop the user out of their current state + GameMessages::SendPlaceModelResponse(entity->GetObjectID(), entity->GetSystemAddress(), entity->GetPosition(), m_Parent->GetObjectID(), 14, entity->GetRotation()); + + return; + } + const auto index = models.find(id); if (index == models.end()) { @@ -441,14 +460,6 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet LOG("Failed to find spawner"); } - auto* model = Game::entityManager->GetEntity(id); - - if (model == nullptr) { - LOG("Failed to find model entity"); - - return; - } - Game::entityManager->DestructEntity(model); LOG("Deleting model LOT %i", model->GetLOT());