mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
don't put actions on other people's avatarEntities
This commit is contained in:
parent
356ccdba26
commit
de12680ff1
3 changed files with 15 additions and 0 deletions
|
@ -187,6 +187,10 @@ void Avatar::updateAvatarEntities() {
|
|||
return;
|
||||
}
|
||||
|
||||
if (getID() == QUuid()) {
|
||||
return; // wait until MyAvatar gets an ID before doing this.
|
||||
}
|
||||
|
||||
EntityTreeRenderer* treeRenderer = qApp->getEntities();
|
||||
EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr;
|
||||
if (!entityTree) {
|
||||
|
|
|
@ -44,6 +44,10 @@ void EntityEditPacketSender::queueEditAvatarEntityMessage(PacketType type,
|
|||
return; // bail early
|
||||
}
|
||||
|
||||
if (properties.getOwningAvatarID() != _myAvatar->getID()) {
|
||||
return; // don't send updates for someone else's avatarEntity
|
||||
}
|
||||
|
||||
assert(properties.getClientOnly());
|
||||
|
||||
// this is an avatar-based entity. update our avatar-data rather than sending to the entity-server
|
||||
|
|
|
@ -788,6 +788,9 @@ bool EntityScriptingInterface::actionWorker(const QUuid& entityID,
|
|||
return false;
|
||||
}
|
||||
|
||||
auto nodeList = DependencyManager::get<NodeList>();
|
||||
const QUuid myNodeID = nodeList->getSessionUUID();
|
||||
|
||||
EntityItemPointer entity;
|
||||
bool doTransmit = false;
|
||||
_entityTree->withWriteLock([&] {
|
||||
|
@ -803,6 +806,10 @@ bool EntityScriptingInterface::actionWorker(const QUuid& entityID,
|
|||
return;
|
||||
}
|
||||
|
||||
if (entity->getClientOnly() && entity->getOwningAvatarID() != nodeList->getSessionUUID()) {
|
||||
return;
|
||||
}
|
||||
|
||||
doTransmit = actor(simulation, entity);
|
||||
if (doTransmit) {
|
||||
_entityTree->entityChanged(entity);
|
||||
|
|
Loading…
Reference in a new issue