BattletechModders / BattletechModders/CleverGirl

BUG: Calculates WillFireAtTarget using currentPosition instead of meleePosition

Open
#23 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
5
Forks
4
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the condensed weapon logic using WillFireAtTargetFromPosition and read how the attack position is represented for melee attacks. Verify the firing decision uses the melee position when evaluating a target reached by charging; done when a target out of range initially can still be considered after moving into melee range.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
game-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.