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

BUG: Calculates WillFireAtTarget using currentPosition instead of meleePosition #23

Open
IceRaptor opened this issue May 23, 2021 · 0 comments

Comments

@IceRaptor
Copy link
Collaborator

Bug in the condensed weapon logic - uses the attacker's current position, instead of the attack position. See this snippet:

            // Evaluate being able to hit the target
            bool willFireAtTarget = cWeapon.First.WillFireAtTargetFromPosition(target, attacker.CurrentPosition, attacker.CurrentRotation);
            bool withinRange = distance <= cWeapon.First.MaxRange;
            Mod.Log.Debug?.Write($" -- willFireAtTarget: {willFireAtTarget}  withinRange: {withinRange}");
            if (willFireAtTarget && withinRange)
            {
                Mod.Log.Debug?.Write($" -- has LOF and is within range, adding to ranged set");
                RangedWeapons.Add(cWeapon);
            }                

This will fail if the target is out of firing range at the start, but can charge into melee. Need to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant