beyond-all-reason / beyond-all-reason/RecoilEngine

Inconsistent handling of maxangledif

Open
#341 2 comments 0 reactions 0 assignees View on GitHub
bug
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.
![image](https://user-images.githubusercontent.com/44480662/185642197-0d847d46-4b90-444d-b647-17c546b56e79.png)

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.