Make entity properties return undefined value after entity is deleted

This commit is contained in:
David Rowe 2016-01-26 22:07:05 +13:00
parent b55856da08
commit 956e70e415

View file

@ -321,6 +321,11 @@ QScriptValue EntityItemProperties::copyToScriptValue(QScriptEngine* engine, bool
QScriptValue properties = engine->newObject();
EntityItemProperties defaultEntityProperties;
if (_created == UNKNOWN_CREATED_TIME) {
// No entity properties can have been set so return without setting any default, zero property values.
return properties;
}
if (_idSet) {
COPY_PROPERTY_TO_QSCRIPTVALUE_GETTER_ALWAYS(id, _id.toString());
}