Skip to content

Commit cf558b0

Browse files
committed
Fixed GetStackSize exception when items are missing.
Fix for some items (construction, coal etc) not stacking correctly.
1 parent db663ae commit cf558b0

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

StackSizeController.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,19 @@ private void OnEntitySpawned(MiniCopter heli)
291291
return;
292292

293293
var hookResult = Interface.CallHook("OnVendorHeliFuelAdjust", heli);
294-
if (hookResult is bool && (bool) hookResult == false)
294+
if (hookResult is bool && (bool)hookResult == false)
295295
return;
296296

297297
fuelItem.amount = 100;
298298
fuelItem.MarkDirty();
299299
});
300300
}
301301

302+
int OnMaxStackable(Item item)
303+
{
304+
return GetStackSize(item.info);
305+
}
306+
302307
#endregion
303308

304309
#region Commands

0 commit comments

Comments
 (0)