mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
fix permissions check
This commit is contained in:
parent
0ebd13b3e6
commit
56493346c1
5 changed files with 7 additions and 9 deletions
|
@ -271,14 +271,13 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties
|
|||
}
|
||||
}
|
||||
|
||||
bool EntityScriptingInterface::addLocalEntityCopy(EntityItemProperties& properties, EntityItemID& id) {
|
||||
bool EntityScriptingInterface::addLocalEntityCopy(EntityItemProperties& properties, EntityItemID& id, bool isClone) {
|
||||
bool success = true;
|
||||
|
||||
id = EntityItemID(QUuid::createUuid());
|
||||
|
||||
if (_entityTree) {
|
||||
_entityTree->withWriteLock([&] {
|
||||
EntityItemPointer entity = _entityTree->addEntity(id, properties);
|
||||
EntityItemPointer entity = _entityTree->addEntity(id, properties, isClone);
|
||||
if (entity) {
|
||||
if (properties.queryAACubeRelatedPropertyChanged()) {
|
||||
// due to parenting, the server may not know where something is in world-space, so include the bounding cube.
|
||||
|
@ -340,7 +339,7 @@ QUuid EntityScriptingInterface::cloneEntity(QUuid entityIDToClone) {
|
|||
// setLastEdited timestamp to 0 to ensure this entity gets updated with the properties
|
||||
// from the server-created entity, don't change this unless you know what you are doing
|
||||
properties.setLastEdited(0);
|
||||
bool success = addLocalEntityCopy(properties, newEntityID);
|
||||
bool success = addLocalEntityCopy(properties, newEntityID, true);
|
||||
if (success) {
|
||||
getEntityPacketSender()->queueCloneEntityMessage(entityIDToClone, newEntityID);
|
||||
return newEntityID;
|
||||
|
|
|
@ -1885,7 +1885,7 @@ private:
|
|||
bool polyVoxWorker(QUuid entityID, std::function<bool(PolyVoxEntityItem&)> actor);
|
||||
bool setPoints(QUuid entityID, std::function<bool(LineEntityItem&)> actor);
|
||||
void queueEntityMessage(PacketType packetType, EntityItemID entityID, const EntityItemProperties& properties);
|
||||
bool addLocalEntityCopy(EntityItemProperties& propertiesWithSimID, EntityItemID& id);
|
||||
bool addLocalEntityCopy(EntityItemProperties& propertiesWithSimID, EntityItemID& id, bool isClone = false);
|
||||
|
||||
EntityItemPointer checkForTreeEntityAndTypeMatch(const QUuid& entityID,
|
||||
EntityTypes::EntityType entityType = EntityTypes::Unknown);
|
||||
|
|
|
@ -493,7 +493,7 @@ bool EntityTree::updateEntity(EntityItemPointer entity, const EntityItemProperti
|
|||
return true;
|
||||
}
|
||||
|
||||
EntityItemPointer EntityTree::addEntity(const EntityItemID& entityID, const EntityItemProperties& properties) {
|
||||
EntityItemPointer EntityTree::addEntity(const EntityItemID& entityID, const EntityItemProperties& properties, bool isClone) {
|
||||
EntityItemPointer result = NULL;
|
||||
EntityItemProperties props = properties;
|
||||
|
||||
|
@ -505,7 +505,7 @@ EntityItemPointer EntityTree::addEntity(const EntityItemID& entityID, const Enti
|
|||
|
||||
if (!properties.getClientOnly() && getIsClient() &&
|
||||
!nodeList->getThisNodeCanRez() && !nodeList->getThisNodeCanRezTmp() &&
|
||||
!nodeList->getThisNodeCanRezCertified() && !nodeList->getThisNodeCanRezTmpCertified() && !_serverlessDomain) {
|
||||
!nodeList->getThisNodeCanRezCertified() && !nodeList->getThisNodeCanRezTmpCertified() && !_serverlessDomain && !isClone) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ public:
|
|||
// The newer API...
|
||||
void postAddEntity(EntityItemPointer entityItem);
|
||||
|
||||
EntityItemPointer addEntity(const EntityItemID& entityID, const EntityItemProperties& properties);
|
||||
EntityItemPointer addEntity(const EntityItemID& entityID, const EntityItemProperties& properties, bool isClone = false);
|
||||
|
||||
// use this method if you only know the entityID
|
||||
bool updateEntity(const EntityItemID& entityID, const EntityItemProperties& properties, const SharedNodePointer& senderNode = SharedNodePointer(nullptr));
|
||||
|
|
|
@ -133,7 +133,6 @@ public:
|
|||
|
||||
EntityClone,
|
||||
|
||||
|
||||
NUM_PACKET_TYPE
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue