beyond-all-reason / beyond-all-reason/RecoilEngine
Inconsistent handling of maxangledif
- Dominant language
- C++
- Stars
- 679
- Forks
- 290
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 40
Description
Units with weapons that have a defined maindir and maxangledif have odd behavior.
1. Calls to the unit's script.AimWeapon still occur even if the target is out-of-arc of the weapon. Therefore, default behavior is the unit animates and rotates its pieces to illegal firing angles.
2. CheckAimingAngle() is improperly using owner->pos instead of aimFromPos. Resulting in situations where the weapon is at a legal firing angle, but relative to the unit center, the angle is illegal, setting angleGood to false. An exaggerated example is shown in the attached image.

Contributor guide
Research direction
Trace the weapon aiming code that handles maindir, maxangledif, script.AimWeapon, and CheckAimingAngle(). Verify the current angle is evaluated from aimFromPos and determine how out-of-arc targets should affect AimWeapon calls; done means illegal animation or rotation is prevented while legal firing angles remain valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100