Fixed issues Player Name found in testing

This commit is contained in:
Bishop 2026-08-01 10:20:55 -05:00
parent 3294db8b32
commit 938f068211
2 changed files with 10 additions and 2 deletions

View file

@ -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;
}

View file

@ -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);
}