Fix fillMagazineWithCartridge()
failing to get a cartridge size when weapon is the rotating grenade launcher
This commit is contained in:
parent
30c15ec9f0
commit
ffc3a28dc8
@ -1032,7 +1032,10 @@ export class ItemHelper
|
||||
const cartridgeMaxStackSize = cartridgeDetails[1]._props.StackMaxSize;
|
||||
|
||||
// Get max number of cartridges in magazine, choose random value between min/max
|
||||
const magazineCartridgeMaxCount = magTemplate._props.Cartridges[0]?._max_count;
|
||||
const magazineCartridgeMaxCount = (this.isOfBaseclass(magTemplate._id, BaseClasses.SPRING_DRIVEN_CYLINDER))
|
||||
? magTemplate._props.Slots.length // Edge case for rotating grenade launcher magazine
|
||||
: magTemplate._props.Cartridges[0]?._max_count;
|
||||
|
||||
if (!magazineCartridgeMaxCount)
|
||||
{
|
||||
this.logger.warning(`Magazine: ${magTemplate._id} ${magTemplate._name} lacks a Cartridges array, unable to fill magazine with ammo`);
|
||||
|
Loading…
Reference in New Issue
Block a user