Fixed autocast bug - Player autocast spell now loads properly on login

This was caused by items being unequipped and re-equipped on login to verify that the player meets the requirements to use it. As a consequence of this bugfix, if the requirements for an item change (like a new quest comes out) then the item won't be forcibly unequipped. I can live with that though.
This commit is contained in:
randy 2025-03-06 21:40:20 -07:00
parent 40d5478b57
commit 9926b5c244

View file

@ -149,11 +149,15 @@ public final class LoginConfiguration {
//We should have already been doing this.
//Frankly, I don't even want to imagine the number of bugs us *not* doing this has caused.
if (item == null) continue;
//Snowscape: removed the re-equip section, as that cleared the autocast spell on login and I don't care about catching the odd item requirement change.
InteractionListeners.run(item.getId(), player, item, true);
/*
player.getEquipment().remove(item);
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());
}
*/
}
SpellBookManager.SpellBook currentSpellBook = SpellBookManager.SpellBook.forInterface(player.getSpellBookManager().getSpellBook());