Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix single combat attacking target #564

Open
GregHib opened this issue Dec 9, 2024 · 0 comments
Open

Fix single combat attacking target #564

GregHib opened this issue Dec 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@GregHib
Copy link
Owner

GregHib commented Dec 9, 2024

Because Target.attackable checks if the player.target is set to the target npc, it means any player can attack an npc even if it's currently in combat because character.target = target inside Combat.kts line 41 which occurs before attackable is checked.

This is because it's based on the assumption that target is only set when in combat. However this isn't true as target is set before entering combat and then removed if not attackable (self satisfying).

It also isn't a trivial fix as setting the target after checking attackable means the player can't re-attack the npc they're already fighting because target is set to null when combat stops for the split second when re-attacking.

@GregHib GregHib added the bug Something isn't working label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant