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 targeting #2786

Merged
merged 2 commits into from
May 11, 2023
Merged

Fix targeting #2786

merged 2 commits into from
May 11, 2023

Conversation

KheirFerrum
Copy link
Collaborator

@KheirFerrum KheirFerrum commented May 9, 2023

Summary

SUMMARY: Bugfixes "Fix targeting"

Purpose of change

Fixes #2567.

Issue was that there's a Character variable and Player variable last_target and last_target_pos, so in aim_activity_actor::finish() the game was checking the wrong variable and resetting the wrong variable.

Describe the solution

Remove unused Character variables last_target and last_target_pos. Fix consideration in aim_activity_actor::finish() so it'll check and update correct variable.

Describe alternatives you've considered

  • Move variable to Character class
    • Good eventual goal. Not doing it here because it'd require fixing up save_game_json.cpp and would probably be better as part of a Player to Character migration.

Testing

Spawn 5 decayed zombies and wield an M4A1. Save

  • Kill all 5 zombies with gun at range without exiting aim, check that cursor never lingers on dead targets.
  • Reload from previous save and test again 5 times.

Additional context

Remove unused Character variables `last_target` and `last_target_pos`. Fix consideration in `aim_activity_actor::finish()` so it'll check and update correct variable
@github-actions github-actions bot added the src PR changes related to source code. label May 9, 2023
@scarf005 scarf005 self-requested a review May 11, 2023 03:50
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

targeting.mp4

confirmed that the targeting works as intended. LGTM

@scarf005 scarf005 merged commit 868c013 into cataclysmbnteam:upload May 11, 2023
12 of 16 checks passed
@KheirFerrum KheirFerrum deleted the Fix-targeting branch May 17, 2023 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src PR changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto aim occasionally re-aims dead enemy
2 participants