If addEntity failed for whatever reason (eg. lack of permission), it would return a non-null UUID. Fixes [FogBugz case #365](https://highfidelity.fogbugz.com/f/cases/356/Entities-addEntity-can-return-a-UUID-even-when-unsuccessful).
Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 1 file). Show all
Unified · Split
| @@ -191,9 +191,11 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties · 190 unmodified lines | ||
| 191 | 191 | if (success) { |
| 192 | 192 | emit debitEnergySource(cost); |
| 193 | 193 | queueEntityMessage(PacketType::EntityAdd, id, propertiesWithSimID); |
| 194 | − } | |
| 195 | 194 | |
| 196 | − return id; | |
| 195 | + return id; | |
| 196 | + } else { | |
| 197 | + return QUuid(); | |
| 198 | + } | |
| 197 | 199 | } |
| 198 | 200 | |
| 199 | 201 | QUuid EntityScriptingInterface::addModelEntity(const QString& name, const QString& modelUrl, const glm::vec3& position) { |