mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-09-08 03:29:48 -04:00
Don't break/place blocks while in the inventory.
This commit is contained in:
parent
a542fb73e4
commit
5160f22e5c
@ -80,12 +80,14 @@ pub const Player = struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn placeBlock() void {
|
pub fn placeBlock() void {
|
||||||
|
if(!main.Window.grabbed) return;
|
||||||
main.renderer.MeshSelection.placeBlock(&inventory__SEND_CHANGES_TO_SERVER.items[selectedSlot]) catch |err| {
|
main.renderer.MeshSelection.placeBlock(&inventory__SEND_CHANGES_TO_SERVER.items[selectedSlot]) catch |err| {
|
||||||
std.log.err("Error while placing block: {s}", .{@errorName(err)});
|
std.log.err("Error while placing block: {s}", .{@errorName(err)});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn breakBlock() void { // TODO: Breaking animation and tools
|
pub fn breakBlock() void { // TODO: Breaking animation and tools
|
||||||
|
if(!main.Window.grabbed) return;
|
||||||
main.renderer.MeshSelection.breakBlock() catch |err| {
|
main.renderer.MeshSelection.breakBlock() catch |err| {
|
||||||
std.log.err("Error while placing block: {s}", .{@errorName(err)});
|
std.log.err("Error while placing block: {s}", .{@errorName(err)});
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user