beyond-all-reason / spring

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

noExplode makes Cannon/DGun partially spherical #1219

Open sprunk opened 10 months ago

sprunk commented 10 months ago

These weapon types get a spherical range mechanics when noExplode is set but everything else (GUI, unit AI such as targeting etc) still behaves as if they're ballistic. Range circle still expands (instead of shrinking) when placed on a hill, a ship will still shoot both seafloor and air targets even if it can't reach them, etc.

lhog commented 9 months ago

Hmm, I don't see any evidences noExplode has any relation to a spherical or not range.

sprunk commented 9 months ago

https://github.com/beyond-all-reason/spring/blob/f5a0a5f8e700eedc35b2e8e81fb39b692988e007/rts/Sim/Projectiles/WeaponProjectiles/ExplosiveProjectile.cpp#L59-L61

https://github.com/beyond-all-reason/spring/blob/f5a0a5f8e700eedc35b2e8e81fb39b692988e007/rts/Sim/Projectiles/WeaponProjectiles/FireBallProjectile.cpp#L99

ExplosiveProjectile comes from weapon type Cannon and FireBallProjectile from weapon type DGun. TraveledRange() is essentially the difference between current and starting position, which is a sphere.