slight optimization

This commit is contained in:
OneAvargeCoder193 2025-07-23 18:42:13 -04:00
parent 0d901b3842
commit 7e320c3bb0

View File

@ -1211,9 +1211,12 @@ pub const Command = struct { // MARK: Command
return; return;
} }
const serverId = user.?.inventoryClientToServerIdMap.get(self.inv.id) orelse unreachable; if(side == .server) {
const source = Sync.ServerSide.inventories.items[serverId].source; const serverId = user.?.inventoryClientToServerIdMap.get(self.inv.id) orelse unreachable;
if(side == .server and source == .blockInventory) { const source = Sync.ServerSide.inventories.items[serverId].source;
if(source != .blockInventory) return;
const pos = source.blockInventory; const pos = source.blockInventory;
const simChunk = main.server.world.?.getSimulationChunkAndIncreaseRefCount(pos[0], pos[1], pos[2]) orelse return; const simChunk = main.server.world.?.getSimulationChunkAndIncreaseRefCount(pos[0], pos[1], pos[2]) orelse return;