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
This commit is contained in:
David Markowitz 2023-11-15 17:32:17 -08:00 committed by GitHub
parent a44f998bd1
commit f59ca8b1da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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());