Fixed issue with items being purged for all bots after a single bot had reached an item limit

(cherry picked from commit f834d14928f5ad3a7d22e6f3d4251d731d203857)
This commit is contained in:
Dev 2024-04-03 20:54:55 +01:00 committed by Refringe
parent 134696c7b3
commit d1e857a408
No known key found for this signature in database
GPG Key ID: 7715B85B4A6306ED

View File

@ -59,28 +59,39 @@ export class BotLootCacheService
this.addLootToCache(botRole, isPmc, botJsonTemplate);
}
let result = undefined;
switch (lootType)
{
case LootCacheType.SPECIAL:
return this.lootCache[botRole].specialItems;
result = this.lootCache[botRole].specialItems;
break;
case LootCacheType.BACKPACK:
return this.lootCache[botRole].backpackLoot;
result = this.lootCache[botRole].backpackLoot;
break;
case LootCacheType.POCKET:
return this.lootCache[botRole].pocketLoot;
result = this.lootCache[botRole].pocketLoot;
break;
case LootCacheType.VEST:
return this.lootCache[botRole].vestLoot;
result = this.lootCache[botRole].vestLoot;
break;
case LootCacheType.SECURE:
return this.lootCache[botRole].secureLoot;
result = this.lootCache[botRole].secureLoot;
break;
case LootCacheType.COMBINED:
return this.lootCache[botRole].combinedPoolLoot;
result = this.lootCache[botRole].combinedPoolLoot;
break;
case LootCacheType.HEALING_ITEMS:
return this.lootCache[botRole].healingItems;
result = this.lootCache[botRole].healingItems;
break;
case LootCacheType.GRENADE_ITEMS:
return this.lootCache[botRole].grenadeItems;
result = this.lootCache[botRole].grenadeItems;
break;
case LootCacheType.DRUG_ITEMS:
return this.lootCache[botRole].drugItems;
result = this.lootCache[botRole].drugItems;
break;
case LootCacheType.STIM_ITEMS:
return this.lootCache[botRole].stimItems;
result = this.lootCache[botRole].stimItems;
break;
default:
this.logger.error(
this.localisationService.getText("bot-loot_type_not_found", {
@ -91,6 +102,8 @@ export class BotLootCacheService
);
break;
}
return this.jsonUtil.clone(result);
}
/**