diff --git a/MCGalaxy/Commands/Fun/CmdGun.cs b/MCGalaxy/Commands/Fun/CmdGun.cs index 8078f7e04..bde162f92 100644 --- a/MCGalaxy/Commands/Fun/CmdGun.cs +++ b/MCGalaxy/Commands/Fun/CmdGun.cs @@ -31,15 +31,11 @@ namespace MCGalaxy.Commands.Fun { p.Message("Guns cannot be used on this map!"); return; } if (p.weapon != null && message.Length == 0) { - p.weapon.Disable(); - p.weapon = null; - return; + p.weapon.Disable(); return; } Gun gun = GetGun(p, message); if (gun == null) { Help(p); return; } - - p.weapon = gun; gun.Enable(p); } diff --git a/MCGalaxy/Games/Weapons/Weapon.cs b/MCGalaxy/Games/Weapons/Weapon.cs index 857121693..01bf59436 100644 --- a/MCGalaxy/Games/Weapons/Weapon.cs +++ b/MCGalaxy/Games/Weapons/Weapon.cs @@ -42,11 +42,12 @@ namespace MCGalaxy.Games { } this.p = p; p.ClearBlockchange(); + p.weapon = this; + p.Blockchange += BlockClickCallback; if (p.Supports(CpeExt.PlayerClick)) { p.Message(Name + " engaged, click to fire at will"); - } else { - p.Blockchange += BlockClickCallback; + } else { p.Message(Name + " engaged, fire at will"); aimer = new AimBox(); aimer.Hook(p); @@ -67,8 +68,9 @@ namespace MCGalaxy.Games { Weapon weapon = p.weapon; if (weapon == null) return; + // always revert block back, client assumes changes always succeed p.RevertBlock(x, y, z); - // defer to player click handler + // defer to player click handler if used if (weapon.aimer == null) return; if (!p.level.Config.Guns) { weapon.Disable(); return; }