mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 12:08:54 +02:00
Merge pull request #8137 from AlexanderOtavka/add-entity
Fix bugs with Entities.addEntity
This commit is contained in:
commit
e4329cc8de
2 changed files with 9 additions and 2 deletions
|
@ -191,9 +191,11 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties
|
||||||
if (success) {
|
if (success) {
|
||||||
emit debitEnergySource(cost);
|
emit debitEnergySource(cost);
|
||||||
queueEntityMessage(PacketType::EntityAdd, id, propertiesWithSimID);
|
queueEntityMessage(PacketType::EntityAdd, id, propertiesWithSimID);
|
||||||
}
|
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
|
} else {
|
||||||
|
return QUuid();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QUuid EntityScriptingInterface::addModelEntity(const QString& name, const QString& modelUrl, const glm::vec3& position) {
|
QUuid EntityScriptingInterface::addModelEntity(const QString& name, const QString& modelUrl, const glm::vec3& position) {
|
||||||
|
|
|
@ -320,6 +320,11 @@ EntityItemPointer EntityTree::addEntity(const EntityItemID& entityID, const Enti
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!properties.getClientOnly() && getIsClient() &&
|
||||||
|
!nodeList->getThisNodeCanRez() && !nodeList->getThisNodeCanRezTmp()) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
bool recordCreationTime = false;
|
bool recordCreationTime = false;
|
||||||
if (props.getCreated() == UNKNOWN_CREATED_TIME) {
|
if (props.getCreated() == UNKNOWN_CREATED_TIME) {
|
||||||
// the entity's creation time was not specified in properties, which means this is a NEW entity
|
// the entity's creation time was not specified in properties, which means this is a NEW entity
|
||||||
|
|
Loading…
Reference in a new issue