remove scripts from avatar attached entities for other avatars

This commit is contained in:
Brad Hefta-Gaub 2016-11-09 12:26:57 -08:00
parent 666d2dd2fc
commit cf3d1011f4

View file

@ -235,6 +235,14 @@ void Avatar::updateAvatarEntities() {
properties.setParentID(getID());
}
// NOTE: if this avatar entity is not attached to us, strip it's entity script completely...
auto attachedScript = properties.getScript();
if (!isMyAvatar() && !attachedScript.isEmpty()) {
qCDebug(interfaceapp) << "removing entity script from avatar attached entity:" << entityID << "old script:" << attachedScript;
QString noScript;
properties.setScript(noScript);
}
EntityItemPointer entity = entityTree->findEntityByEntityItemID(EntityItemID(entityID));
if (entity) {