Mimic live behaviour for ammo box locarion values
This commit is contained in:
parent
b5639f481f
commit
9819ac3737
@ -414,7 +414,7 @@ export class BotLootGenerator
|
||||
// Fill ammo box
|
||||
if (this.itemHelper.isOfBaseclass(itemToAddTemplate._id, BaseClasses.AMMO_BOX))
|
||||
{
|
||||
this.itemHelper.addSingleStackCartridgesToAmmoBox(itemToAddChildrenTo, itemToAddTemplate);
|
||||
this.itemHelper.addCartridgesToAmmoBox(itemToAddChildrenTo, itemToAddTemplate);
|
||||
}
|
||||
// Make money a stack
|
||||
else if (this.itemHelper.isOfBaseclass(itemToAddTemplate._id, BaseClasses.MONEY))
|
||||
|
@ -847,7 +847,7 @@ export class LocationGenerator
|
||||
{
|
||||
// Fill with cartridges
|
||||
const ammoBoxItem: Item[] = [{ _id: this.objectId.generate(), _tpl: chosenTpl }];
|
||||
this.itemHelper.addSingleStackCartridgesToAmmoBox(ammoBoxItem, itemTemplate);
|
||||
this.itemHelper.addCartridgesToAmmoBox(ammoBoxItem, itemTemplate);
|
||||
itemWithMods.push(...ammoBoxItem);
|
||||
}
|
||||
else if (this.itemHelper.isOfBaseclass(chosenTpl, BaseClasses.MAGAZINE))
|
||||
@ -1057,7 +1057,7 @@ export class LocationGenerator
|
||||
// No spawnpoint to fall back on, generate manually
|
||||
else if (this.itemHelper.isOfBaseclass(chosenTpl, BaseClasses.AMMO_BOX))
|
||||
{
|
||||
this.itemHelper.addSingleStackCartridgesToAmmoBox(items, itemTemplate);
|
||||
this.itemHelper.addCartridgesToAmmoBox(items, itemTemplate);
|
||||
}
|
||||
else if (this.itemHelper.isOfBaseclass(chosenTpl, BaseClasses.MAGAZINE))
|
||||
{
|
||||
|
@ -1049,16 +1049,22 @@ export class ItemHelper
|
||||
const cartridgeCountToAdd = (remainingSpace < maxPerStack) ? remainingSpace : maxPerStack;
|
||||
|
||||
// Add cartridge item into items array
|
||||
ammoBox.push(
|
||||
this.createCartridges(
|
||||
const cartridgeItemToAdd = this.createCartridges(
|
||||
ammoBox[0]._id,
|
||||
cartridgeTpl,
|
||||
cartridgeCountToAdd,
|
||||
location,
|
||||
ammoBox[0].upd?.SpawnedInSession,
|
||||
),
|
||||
);
|
||||
|
||||
// In live no ammo box has the first cartridge item with a location
|
||||
if (location === 0)
|
||||
{
|
||||
delete cartridgeItemToAdd.location;
|
||||
}
|
||||
|
||||
ammoBox.push(cartridgeItemToAdd);
|
||||
|
||||
currentStoredCartridgeCount += cartridgeCountToAdd;
|
||||
location++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user