Teleport capabilites bug
Is it really a Bug report? Yes.
Botty Version 0.7.3 non-compiled fresh from master
Describe the bug The bot decides to have teleport charges only from setting the teleport hotkey in the config. It skips the test if teleport can be selected or has charges.
To Reproduce Steps to reproduce the behavior:
- Use Non-Sorc class
- Unequip any teleport. Enigma, amulet, etc.
- Grab fresh copy from master
- Set only type=hammerdin and teleport=r (or whatever your usual teleport hotkey is under [Paladin]). Don't change anything else.
- Start the bot.
- Observe: INFO Capabilities: CharacterCapabilities(can_teleport_natively=False, can_teleport_with_charges=True)
The bot claims to have teleport charges, even though we removed any and all teleport items.
Expected behavior The bot should not claim to have teleport charges, if no teleport charges items are equipped.
Screenshots / Video
Logs
Additional info The problem is here:
def _discover_capabilities(self) -> CharacterCapabilities:
override = Config().advanced_options["override_capabilities"]
if override is None:
if self._skill_hotkeys["teleport"]:
if self.select_tp():
if self.skill_is_charged():
return CharacterCapabilities(can_teleport_natively=False, can_teleport_with_charges=True)
else:
return CharacterCapabilities(can_teleport_natively=True, can_teleport_with_charges=False)
return CharacterCapabilities(can_teleport_natively=False, can_teleport_with_charges=True) #here
else:
return CharacterCapabilities(can_teleport_natively=False, can_teleport_with_charges=False)
else:
Logger.debug(f"override_capabilities is set to {override}")
return CharacterCapabilities(
can_teleport_natively="can_teleport_natively" in override,
can_teleport_with_charges="can_teleport_with_charges" in override
)
The bot returns true for teleport charges if the teleport hotkey has been set. He skip all other checks if the character doesn't actually have teleport and just (incorrectly) returns true. Changing the second can_teleport_with_charges=True to =False fixes the bug and (at least the Hammerdin) functions at expected with Enigma, teleport amulet or nothing at all.
There should only be one case where can_teleport_with_charges=True.
Will this fix the Vigor issue ?
And also, what if we use Staff with teleport charges on the second hand? The bot is not switching the hands :(