Skip to content

BUG: Calculates WillFireAtTarget using currentPosition instead of meleePosition #23

@IceRaptor

Description

@IceRaptor

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions