diff --git a/lib/classes/ObjectStoreFull.ts b/lib/classes/ObjectStoreFull.ts index 2ba3b03..0ca484c 100644 --- a/lib/classes/ObjectStoreFull.ts +++ b/lib/classes/ObjectStoreFull.ts @@ -127,6 +127,18 @@ export class ObjectStoreFull implements IObjectStore if (this.objects[localID].PCode === PCode.Avatar && this.objects[localID].FullID.toString() === this.agent.agentID.toString()) { this.agent.localID = localID; + + if (this.options & BotOptionFlags.StoreMyAttachmentsOnly) + { + Object.keys(this.objectsByParent).forEach((objParentID: string) => + { + const parent = parseInt(objParentID, 10); + if (parent !== this.agent.localID) + { + this.deleteObject(parent); + } + }); + } } this.readExtraParams(objData.ExtraParams, 0, this.objects[localID]); diff --git a/lib/classes/ObjectStoreLite.ts b/lib/classes/ObjectStoreLite.ts index cbd16e3..e4e9a85 100644 --- a/lib/classes/ObjectStoreLite.ts +++ b/lib/classes/ObjectStoreLite.ts @@ -86,6 +86,18 @@ export class ObjectStoreLite implements IObjectStore if (objData.PCode === PCode.Avatar && this.objects[localID].FullID.toString() === this.agent.agentID.toString()) { this.agent.localID = localID; + + if (this.options & BotOptionFlags.StoreMyAttachmentsOnly) + { + Object.keys(this.objectsByParent).forEach((objParentID: string) => + { + const parent = parseInt(objParentID, 10); + if (parent !== this.agent.localID) + { + this.deleteObject(parent); + } + }); + } } this.objectsByUUID[objData.FullID.toString()] = localID;