Files
Bubberstation/code/modules/projectiles
SkyratBot 1e03a555d7 [MIRROR] Fixes runtime with out of bounds hitscan projectiles (#28415)
* Fixes runtime with out of bounds hitscan projectiles (#84192)

## About The Pull Request
When projectiles cross into an invalid turf (like crossing out of the
bounds of the map), they are automatically qdel'd. If the projectile is
hitscanning, the `Destroy()` will call
`finalize_hitscan_and_generate_tracers()`. The projectile's
`trajectory`, which points to the invalid turf that caused the deletion
in the first place, is passed as the `ending_atom` of `get_line()`,
which returns a list of turfs between the shooter and the point (turf)
of termination.

Since the ending turf is by necessity null at this point, a runtime
occurs. Instead, we decrement the trajectory back a step
(`-trajectory_multiplier`) so that it's pointing at a valid turf on
`Destroy()`.

## Why It's Good For The Game
We experienced this runtime on Paradise a lot and the log spam got kind
of annoying. Since it's the same system, I figured I would PR it
upstream as well.

* Fixes runtime with out of bounds hitscan projectiles

---------

Co-authored-by: chuga-git <98280110+chuga-git@users.noreply.github.com>
2024-06-27 14:07:45 +05:30
..