mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-20 10:45:27 +00:00
fix: only the owner of a property changes it
The messages that set a property's privacy option and name, start and finish building, place, move and remove models and change a model's behaviors were handled for any player on the property, and outside of a property they used a property that is not there. They are now only handled for the owner of the property the player is on. Only an item from a model inventory is placed as a model. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -529,6 +529,15 @@ void PropertyManagementComponent::UpdateModelPosition(Entity& builder, const LWO
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only a model is placed on a property
|
||||||
|
const auto* const itemInventory = item->GetInventory();
|
||||||
|
const auto itemInventoryType = itemInventory ? itemInventory->GetType() : eInventoryType::INVALID;
|
||||||
|
if (itemInventoryType != eInventoryType::MODELS && itemInventoryType != eInventoryType::MODELS_IN_BBB && itemInventoryType != eInventoryType::TEMP_MODELS) {
|
||||||
|
LOG("Item %llu (LOT %i) is not in a model inventory and can not be placed", id, item->GetLot());
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const NiQuaternion originalRotation = rotation;
|
const NiQuaternion originalRotation = rotation;
|
||||||
if (rotation != QuatUtils::IDENTITY) {
|
if (rotation != QuatUtils::IDENTITY) {
|
||||||
rotation = { rotation.w, rotation.z, rotation.y, rotation.x };
|
rotation = { rotation.w, rotation.z, rotation.y, rotation.x };
|
||||||
|
|||||||
@@ -444,11 +444,11 @@ namespace GameMessages {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PropertyContentsFromClient::Handle(Entity& entity, const SystemAddress& sysAddr) {
|
void PropertyContentsFromClient::Handle(Entity& entity, const SystemAddress& sysAddr) {
|
||||||
User* user = UserManager::Instance()->GetUser(sysAddr);
|
const auto* const player = PlayerManager::GetPlayer(sysAddr);
|
||||||
|
const auto* const propertyManagementComponent = PropertyManagementComponent::Instance();
|
||||||
|
if (!player || !propertyManagementComponent) return;
|
||||||
|
|
||||||
Entity* player = Game::entityManager->GetEntity(user->GetLoggedInChar());
|
const auto& models = propertyManagementComponent->GetModels();
|
||||||
|
|
||||||
const auto& models = PropertyManagementComponent::Instance()->GetModels();
|
|
||||||
GetModelsOnProperty modelsOnProperty;
|
GetModelsOnProperty modelsOnProperty;
|
||||||
modelsOnProperty.target = player->GetObjectID();
|
modelsOnProperty.target = player->GetObjectID();
|
||||||
modelsOnProperty.models = { models.begin(), models.end() };
|
modelsOnProperty.models = { models.begin(), models.end() };
|
||||||
|
|||||||
Reference in New Issue
Block a user