fix bug in getContainingElement() found by andrew, allow sciprting interface to return properties of local only entities

This commit is contained in:
ZappoMan 2014-09-03 13:14:06 -07:00
parent 756840d541
commit 76511762dc
2 changed files with 2 additions and 8 deletions

View file

@ -64,10 +64,6 @@ EntityItemID EntityScriptingInterface::identifyEntity(EntityItemID entityID) {
EntityItemProperties EntityScriptingInterface::getEntityProperties(EntityItemID entityID) {
EntityItemProperties results;
EntityItemID identity = identifyEntity(entityID);
if (!identity.isKnownID) {
results.setIsUnknownID();
return results;
}
if (_entityTree) {
_entityTree->lockForRead();
EntityItem* entity = const_cast<EntityItem*>(_entityTree->findEntityByEntityItemID(identity));

View file

@ -953,11 +953,9 @@ EntityTreeElement* EntityTree::getContainingElement(const EntityItemID& entityIt
creatorTokenOnly.id = UNKNOWN_ENTITY_ID;
creatorTokenOnly.creatorTokenID = entityItemID.creatorTokenID;
creatorTokenOnly.isKnownID = false;
if (_entityToElementMap.contains(entityItemID)) {
return _entityToElementMap.value(entityItemID);
if (_entityToElementMap.contains(creatorTokenOnly)) {
return _entityToElementMap.value(creatorTokenOnly);
}
}
return NULL;
}