This works by:
- Firing a 0-damage bullet that is assigned a TID, which uses autoaim.
- Calculating the pitch from which the A_RailAttack needs to be fired based on the player's position and the puff's position.
- Returning the pitch to the call to A_RailAttack on the weapon, which has the RGF_EXPLICITANGLE flag set.
Other than using this for autoaim, one could create a weapon that uses an angled sprite and shoots an angled RailAttack that hits where the player is aiming.
Provisions for this were started but weren't finished.
There are a couple of known bugs:
- Two bullet chips are created per attack if you allow the weapon to use decals.
- Over long distances, the attack is wildly inaccurate, due to conversion between floating point and fixed point values.
http://zdoom.org/wiki/Distance
If you use this in your mod, credit to us is appreciated but absolutely not mandatory!
Screenshot:
Spoiler:Download