check if the item in the crafting inventory is null before using it.

fixes #1256
This commit is contained in:
IntegratedQuantum 2025-03-30 19:30:11 +02:00
parent a7052d25f5
commit 2766b263c4

View File

@ -1000,6 +1000,7 @@ pub const Command = struct { // MARK: Command
std.debug.assert(dest.inv.type == .normal);
if(source.slot != source.inv._items.len - 1) return;
if(dest.ref().item != null and !std.meta.eql(dest.ref().item, source.ref().item)) return;
if(source.ref().item == null) return; // Can happen if the we didn't receive the inventory information from the server yet.
if(dest.ref().amount + source.ref().amount > source.ref().item.?.stackSize()) return;
const playerInventory: Inventory = switch(side) {