mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-22 21:43:35 +00:00
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:
parent
a44f998bd1
commit
f59ca8b1da
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user