mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-03 03:06:55 -04:00
check if the item in the crafting inventory is null before using it.
fixes #1256
This commit is contained in:
parent
a7052d25f5
commit
2766b263c4
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user