beyond-all-reason / beyond-all-reason/RecoilEngine
Check the hidden cap on `firetolerance`
- Dominant language
- C++
- Stars
- 679
- Forks
- 290
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 40
Description
https://github.com/beyond-all-reason/spring/blob/e55ce6231a0b125f41f56688277dca95ddc7b3bd/rts/Sim/Weapons/Weapon.cpp#L371-L372
The first line checks the angle against `maxFireAngle` (which is the internal engine name for what Lua defs call `fireTolerance`).
The second line looks like it checks the same angle against an arbitrary 20° angle.
This sounds like it would mean setting firetolerance above 20° does nothing because any angle larger than 20° is caught anyway by the hardcoded check.
The task is to:
* verify that the description above matches reality
* get rid of the hardcoded check
* I don't see a reason to cap `fireTolerance`, especially since the default is already supposed to match the hardcoded check. But if you discover a good reason the check was there then put an explicit maximum on `fireTolerance` in `WeaponDef.cpp`.
Contributor guide
Research direction
Start at rts/Sim/Weapons/Weapon.cpp lines 371-372 and trace maxFireAngle to confirm whether the hardcoded 20° check overrides Lua fireTolerance values. Then inspect WeaponDef.cpp for the definition and defaults; done means removing the hardcoded check, or documenting and enforcing an explicit maximum if the investigation finds a valid reason for the cap.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100