Vastly simplify the object resolution stuff.
This commit is contained in:
@@ -66,7 +66,7 @@ export class Avatar extends AvatarQueryResult
|
||||
const objs: GameObject[] = this._gameObject.region.objects.getObjectsByParent(this._gameObject.ID);
|
||||
for (const attachment of objs)
|
||||
{
|
||||
this._gameObject.region.clientCommands.region.resolveObject(attachment, true, false).then(() =>
|
||||
this._gameObject.region.clientCommands.region.resolveObject(attachment, {}).then(() =>
|
||||
{
|
||||
this.addAttachment(attachment);
|
||||
}).catch(() =>
|
||||
@@ -238,8 +238,11 @@ export class Avatar extends AvatarQueryResult
|
||||
{
|
||||
if (obj.itemID !== undefined)
|
||||
{
|
||||
this.attachments[obj.itemID.toString()] = obj;
|
||||
this.onAttachmentAdded.next(obj);
|
||||
if (this.attachments[obj.itemID.toString()] === undefined)
|
||||
{
|
||||
this.attachments[obj.itemID.toString()] = obj;
|
||||
this.onAttachmentAdded.next(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -946,8 +946,13 @@ export class GameObject implements IGameObjectData
|
||||
throw new Error('Failed to add script to object');
|
||||
}
|
||||
|
||||
updateInventory(): Promise<void>
|
||||
public async updateInventory(): Promise<void>
|
||||
{
|
||||
if (this.PCode === PCode.Avatar)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const req = new RequestTaskInventoryMessage();
|
||||
req.AgentData = {
|
||||
AgentID: this.region.agent.agentID,
|
||||
@@ -1501,10 +1506,14 @@ export class GameObject implements IGameObjectData
|
||||
|
||||
private async getXML(xml: XMLNode, rootPrim: GameObject, linkNum: number, rootNode?: string): Promise<void>
|
||||
{
|
||||
if ((this.resolvedAt === undefined || this.resolvedAt === 0 || !this.resolvedInventory) && this.region?.resolver)
|
||||
const resolver = this.region?.resolver;
|
||||
if (resolver)
|
||||
{
|
||||
await this.region.resolver.resolveObjects([this], { onlyUnresolved: false });
|
||||
await resolver.resolveObjects([this], { includeTempObjects: true });
|
||||
await resolver.getInventory(this);
|
||||
await resolver.getCosts([this]);
|
||||
}
|
||||
|
||||
let root = xml;
|
||||
if (rootNode)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user