mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-13 09:50:43 -05:00
Optimisation: addAmmoIntoEquipmentSlots()
, if it fails because of lack of space, break out of loop and skip trying to add remaining ammo
This commit is contained in:
parent
a0016ae2fa
commit
5a2f6b7581
@ -132,9 +132,15 @@ export class BotWeaponGeneratorHelper
|
|||||||
ammoItem,
|
ammoItem,
|
||||||
], inventory);
|
], inventory);
|
||||||
|
|
||||||
if (result === ItemAddedResult.NO_SPACE)
|
if (result !== ItemAddedResult.SUCCESS)
|
||||||
{
|
{
|
||||||
this.logger.debug(`Unable to add ammo: ${ammoItem._tpl} to bot equipment`);
|
this.logger.debug(`Unable to add ammo: ${ammoItem._tpl} to bot equipment, ${ItemAddedResult[result]}`);
|
||||||
|
|
||||||
|
if (result === ItemAddedResult.NO_SPACE)
|
||||||
|
{
|
||||||
|
// If there's no space for 1 stack, there's no space for the others
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user