goonstation-2016 icon indicating copy to clipboard operation
goonstation-2016 copied to clipboard

Fixed certain projectiles in bullet.dm incorrectly reading the state …

Open Vextrom opened this issue 4 years ago • 0 comments

…of the projectile's power.

Certain projectiles used conditional statements checking power, to see if the projectile has lost too much power. However, this was incorrectly defined and it was checking the power of /datum/projectile, rather than /obj/projectile. Because of this, these conditional expressions were always returning true.

The on_hit() proc defined in projectile_parent.dm has an argument for passing the /obj/projectile into the body of the proc. I have modified the on_hit() procs defined in the children of /datum/projectile/ to include this argument, so they can then check the power of /obj/projectile as the power of the projectile dissipates.

Note: There is a var in /datum/projectile called master that, in theory could also be used to access /obj/projectile. However, this var is never set in any of the procs in /datum/projectile.

Vextrom avatar Aug 11 '19 07:08 Vextrom