Don't break/place blocks while in the inventory.

This commit is contained in:
IntegratedQuantum 2024-01-12 22:59:56 +01:00
parent a542fb73e4
commit 5160f22e5c

View File

@ -80,12 +80,14 @@ pub const Player = struct {
}
pub fn placeBlock() void {
if(!main.Window.grabbed) return;
main.renderer.MeshSelection.placeBlock(&inventory__SEND_CHANGES_TO_SERVER.items[selectedSlot]) catch |err| {
std.log.err("Error while placing block: {s}", .{@errorName(err)});
};
}
pub fn breakBlock() void { // TODO: Breaking animation and tools
if(!main.Window.grabbed) return;
main.renderer.MeshSelection.breakBlock() catch |err| {
std.log.err("Error while placing block: {s}", .{@errorName(err)});
};