diff --git a/Server/src/main/core/game/node/entity/combat/equipment/WeaponInterface.java b/Server/src/main/core/game/node/entity/combat/equipment/WeaponInterface.java index 4716e7939..e69802089 100644 --- a/Server/src/main/core/game/node/entity/combat/equipment/WeaponInterface.java +++ b/Server/src/main/core/game/node/entity/combat/equipment/WeaponInterface.java @@ -308,6 +308,9 @@ public final class WeaponInterface extends Component { slot = 3; } } + if (current == WeaponInterfaces.STAFF && slot <= 2) { + removeAttributes(player, attributeAutocastButtonId, attributeAutocastStyle); + } if (slot < 0 || slot >= current.getAttackStyles().length) { return false; } @@ -534,7 +537,7 @@ public final class WeaponInterface extends Component { public boolean restoreAutocast() { int buttonID = getAttribute(player, attributeAutocastButtonId, -1); int style = getAttribute(player, attributeAutocastStyle, -1); - if (buttonID < 0 || style < 0 || current != WeaponInterfaces.STAFF || !canAutocast(false)) { + if (buttonID < 0 || style < 0 || !canAutocast(false)) { removeAttributes(player, attributeAutocastButtonId, attributeAutocastStyle); return false; } diff --git a/Server/src/main/core/game/node/entity/player/info/login/LoginConfiguration.java b/Server/src/main/core/game/node/entity/player/info/login/LoginConfiguration.java index e1c4bdbf0..9fdf421cb 100644 --- a/Server/src/main/core/game/node/entity/player/info/login/LoginConfiguration.java +++ b/Server/src/main/core/game/node/entity/player/info/login/LoginConfiguration.java @@ -151,9 +151,14 @@ public final class LoginConfiguration { if (!InteractionListeners.run(item.getId(), player, item, true) || !player.getEquipment().add(item, true, false)) { player.sendMessage(colorize("%RAs you can no longer wear " + item.getName() + ", it has been unequipped.")); addItemOrBank(player, item.getId(), item.getAmount()); + if (equipSlot(item.getId()) == EquipmentSlot.WEAPON) { + // Default to accurate style if weapon frisk failed + WeaponInterface inter = player.getExtension(WeaponInterface.class); + inter.restoreAttackStyle(0); + } } else if (equipSlot(item.getId()) == EquipmentSlot.WEAPON) { - // Put player's weapon style back to how it was before it was re-equipped. WeaponInterface inter = player.getExtension(WeaponInterface.class); + // Put player's weapon style back to how it was before it was re-equipped if (!inter.restoreAutocast()) { inter.restoreAttackStyle(savedAttackStyle); }