mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-09-08 19:50:23 -04:00
Disallow the .fillFromCreative command outside of creative mode.
fixes #1022 fixes #743
This commit is contained in:
parent
c9bac6377e
commit
5bea8f41b6
@ -1394,8 +1394,10 @@ pub const Command = struct { // MARK: Command
|
||||
item: ?Item,
|
||||
amount: u16 = 0,
|
||||
|
||||
fn run(self: FillFromCreative, allocator: NeverFailingAllocator, cmd: *Command, side: Side, _: ?*main.server.User, _: Gamemode) error{serverFailure}!void {
|
||||
fn run(self: FillFromCreative, allocator: NeverFailingAllocator, cmd: *Command, side: Side, user: ?*main.server.User, mode: Gamemode) error{serverFailure}!void {
|
||||
if(self.dest.inv.type == .workbench and self.dest.slot == 25) return;
|
||||
if(side == .server and user != null and mode != .creative) return;
|
||||
if(side == .client and mode != .creative) return;
|
||||
|
||||
if(!self.dest.ref().empty()) {
|
||||
cmd.executeBaseOperation(allocator, .{.delete = .{
|
||||
|
Loading…
x
Reference in New Issue
Block a user