Ensure task copied inventory is named correctly
This commit is contained in:
@@ -845,7 +845,7 @@ export class RegionCommands extends CommandsBase
|
|||||||
const item = buildMap.assetMap.clothing[invItem.assetID.toString()].item;
|
const item = buildMap.assetMap.clothing[invItem.assetID.toString()].item;
|
||||||
if (item !== null)
|
if (item !== null)
|
||||||
{
|
{
|
||||||
await object.dropInventoryIntoContents(item);
|
await object.dropInventoryIntoContents(item, invItem.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -857,7 +857,7 @@ export class RegionCommands extends CommandsBase
|
|||||||
const item = buildMap.assetMap.settings[invItem.assetID.toString()].item;
|
const item = buildMap.assetMap.settings[invItem.assetID.toString()].item;
|
||||||
if (item !== null)
|
if (item !== null)
|
||||||
{
|
{
|
||||||
await object.dropInventoryIntoContents(item);
|
await object.dropInventoryIntoContents(item, invItem.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -870,7 +870,7 @@ export class RegionCommands extends CommandsBase
|
|||||||
const item = buildMap.assetMap.bodyparts[invItem.assetID.toString()].item;
|
const item = buildMap.assetMap.bodyparts[invItem.assetID.toString()].item;
|
||||||
if (item !== null)
|
if (item !== null)
|
||||||
{
|
{
|
||||||
await object.dropInventoryIntoContents(item);
|
await object.dropInventoryIntoContents(item, invItem.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -882,7 +882,7 @@ export class RegionCommands extends CommandsBase
|
|||||||
const item = buildMap.assetMap.notecards[invItem.assetID.toString()].item;
|
const item = buildMap.assetMap.notecards[invItem.assetID.toString()].item;
|
||||||
if (item !== null)
|
if (item !== null)
|
||||||
{
|
{
|
||||||
await object.dropInventoryIntoContents(item);
|
await object.dropInventoryIntoContents(item, invItem.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -894,7 +894,7 @@ export class RegionCommands extends CommandsBase
|
|||||||
const item = buildMap.assetMap.sounds[invItem.assetID.toString()].item;
|
const item = buildMap.assetMap.sounds[invItem.assetID.toString()].item;
|
||||||
if (item !== null)
|
if (item !== null)
|
||||||
{
|
{
|
||||||
await object.dropInventoryIntoContents(item);
|
await object.dropInventoryIntoContents(item, invItem.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -906,7 +906,7 @@ export class RegionCommands extends CommandsBase
|
|||||||
const item = buildMap.assetMap.gestures[invItem.assetID.toString()].item;
|
const item = buildMap.assetMap.gestures[invItem.assetID.toString()].item;
|
||||||
if (item !== null)
|
if (item !== null)
|
||||||
{
|
{
|
||||||
await object.dropInventoryIntoContents(item);
|
await object.dropInventoryIntoContents(item, invItem.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -919,7 +919,7 @@ export class RegionCommands extends CommandsBase
|
|||||||
const item = buildMap.assetMap.scripts[invItem.assetID.toString()].item;
|
const item = buildMap.assetMap.scripts[invItem.assetID.toString()].item;
|
||||||
if (item !== null)
|
if (item !== null)
|
||||||
{
|
{
|
||||||
await object.dropInventoryIntoContents(item);
|
await object.dropInventoryIntoContents(item, invItem.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -931,7 +931,7 @@ export class RegionCommands extends CommandsBase
|
|||||||
const item = buildMap.assetMap.animations[invItem.assetID.toString()].item;
|
const item = buildMap.assetMap.animations[invItem.assetID.toString()].item;
|
||||||
if (item !== null)
|
if (item !== null)
|
||||||
{
|
{
|
||||||
await object.dropInventoryIntoContents(item);
|
await object.dropInventoryIntoContents(item, invItem.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -943,7 +943,7 @@ export class RegionCommands extends CommandsBase
|
|||||||
const inventoryItem = buildMap.assetMap.objects[invItem.itemID.toString()];
|
const inventoryItem = buildMap.assetMap.objects[invItem.itemID.toString()];
|
||||||
if (inventoryItem !== null)
|
if (inventoryItem !== null)
|
||||||
{
|
{
|
||||||
await object.dropInventoryIntoContents(inventoryItem);
|
await object.dropInventoryIntoContents(inventoryItem, invItem.name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -960,7 +960,7 @@ export class RegionCommands extends CommandsBase
|
|||||||
const texItem = buildMap.assetMap.textures[invItem.assetID.toString()];
|
const texItem = buildMap.assetMap.textures[invItem.assetID.toString()];
|
||||||
if (texItem.item !== null)
|
if (texItem.item !== null)
|
||||||
{
|
{
|
||||||
await object.dropInventoryIntoContents(texItem.item);
|
await object.dropInventoryIntoContents(texItem.item, invItem.name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1268,34 +1268,6 @@ export class RegionCommands extends CommandsBase
|
|||||||
buildMap.primReservoir = await this.createPrims(buildMap.primsNeeded, agentPos);
|
buildMap.primReservoir = await this.createPrims(buildMap.primsNeeded, agentPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
const parts = [];
|
|
||||||
parts.push(this.buildPart(obj, Vector3.getZero(), Quaternion.getIdentity(), buildMap, skipMove));
|
|
||||||
|
|
||||||
if (obj.children)
|
|
||||||
{
|
|
||||||
if (obj.Position === undefined)
|
|
||||||
{
|
|
||||||
obj.Position = Vector3.getZero();
|
|
||||||
}
|
|
||||||
if (obj.Rotation === undefined)
|
|
||||||
{
|
|
||||||
obj.Rotation = Quaternion.getIdentity();
|
|
||||||
}
|
|
||||||
let childNumber = 0;
|
|
||||||
for (const child of obj.children)
|
|
||||||
{
|
|
||||||
if (child.Position !== undefined && child.Rotation !== undefined)
|
|
||||||
{
|
|
||||||
const objPos = new Vector3(obj.Position);
|
|
||||||
const objRot = new Quaternion(obj.Rotation);
|
|
||||||
parts.push(this.buildPart(child, objPos, objRot, buildMap, skipMove));
|
|
||||||
console.log(' ... Building child ' + String(++childNumber));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const results: GameObject[] = await Promise.all(parts);
|
|
||||||
*/
|
|
||||||
let storedPosition: Vector3 | undefined = undefined;
|
let storedPosition: Vector3 | undefined = undefined;
|
||||||
if (skipMove)
|
if (skipMove)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2000,7 +2000,7 @@ export class GameObject implements IGameObjectData
|
|||||||
return GameObject.takeManyToInventory(this.region, [this], folder);
|
return GameObject.takeManyToInventory(this.region, [this], folder);
|
||||||
}
|
}
|
||||||
|
|
||||||
async dropInventoryIntoContents(inventoryItem: InventoryItem | UUID): Promise<void>
|
async dropInventoryIntoContents(inventoryItem: InventoryItem | UUID, newName?: string): Promise<void>
|
||||||
{
|
{
|
||||||
const transactionID = UUID.zero();
|
const transactionID = UUID.zero();
|
||||||
|
|
||||||
@@ -2043,7 +2043,7 @@ export class GameObject implements IGameObjectData
|
|||||||
Flags: inventoryItem.flags,
|
Flags: inventoryItem.flags,
|
||||||
SaleType: inventoryItem.saleType,
|
SaleType: inventoryItem.saleType,
|
||||||
SalePrice: inventoryItem.salePrice,
|
SalePrice: inventoryItem.salePrice,
|
||||||
Name: Utils.StringToBuffer(inventoryItem.name),
|
Name: Utils.StringToBuffer(newName ?? inventoryItem.name),
|
||||||
Description: Utils.StringToBuffer(inventoryItem.description),
|
Description: Utils.StringToBuffer(inventoryItem.description),
|
||||||
CreationDate: inventoryItem.created.getTime() / 1000,
|
CreationDate: inventoryItem.created.getTime() / 1000,
|
||||||
CRC: inventoryItem.getCRC()
|
CRC: inventoryItem.getCRC()
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@caspertech/node-metaverse",
|
"name": "@caspertech/node-metaverse",
|
||||||
"version": "0.7.6",
|
"version": "0.7.7",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@caspertech/node-metaverse",
|
"name": "@caspertech/node-metaverse",
|
||||||
"version": "0.7.6",
|
"version": "0.7.7",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@caspertech/llsd": "^1.0.5",
|
"@caspertech/llsd": "^1.0.5",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@caspertech/node-metaverse",
|
"name": "@caspertech/node-metaverse",
|
||||||
"version": "0.7.6",
|
"version": "0.7.7",
|
||||||
"description": "A node.js interface for Second Life.",
|
"description": "A node.js interface for Second Life.",
|
||||||
"main": "dist/lib/index.js",
|
"main": "dist/lib/index.js",
|
||||||
"types": "dist/lib/index.d.ts",
|
"types": "dist/lib/index.d.ts",
|
||||||
|
|||||||
Reference in New Issue
Block a user