beyond-all-reason / spring

A powerful free cross-platform RTS game engine
https://beyond-all-reason.github.io/spring/
Other
182 stars 95 forks source link

Check the hidden cap on `firetolerance` #1450

Open sprunk opened 3 months ago

sprunk commented 3 months ago

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: