Merge pull request #8137 from AlexanderOtavka/add-entity

Fix bugs with Entities.addEntity
This commit is contained in:
Andrew Meadows 2016-06-28 09:54:09 -07:00 committed by GitHub
commit e4329cc8de
2 changed files with 9 additions and 2 deletions

View file

@ -191,9 +191,11 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties
if (success) {
emit debitEnergySource(cost);
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) {

View file

@ -320,6 +320,11 @@ EntityItemPointer EntityTree::addEntity(const EntityItemID& entityID, const Enti
return nullptr;
}
if (!properties.getClientOnly() && getIsClient() &&
!nodeList->getThisNodeCanRez() && !nodeList->getThisNodeCanRezTmp()) {
return nullptr;
}
bool recordCreationTime = false;
if (props.getCreated() == UNKNOWN_CREATED_TIME) {
// the entity's creation time was not specified in properties, which means this is a NEW entity