Shooting fuel tanks now is logged properly

objects that get qdeleted are only hit once by bullets
This commit is contained in:
joep van der velden
2021-11-10 10:23:47 +01:00
parent 1c3c2c22ad
commit 39a280effd
2 changed files with 8 additions and 6 deletions
+6 -6
View File
@@ -107,13 +107,13 @@
return ..()
/obj/structure/reagent_dispensers/fueltank/bullet_act(obj/item/projectile/P)
var/will_explode = !QDELETED(src) && !P.nodamage && (P.damage_type == BURN || P.damage_type == BRUTE)
if(will_explode) // Log here while you have the information needed
add_attack_logs(P.firer, src, "shot with [P.name]", ATKLOG_FEW)
log_game("[key_name(P.firer)] triggered a fueltank explosion with [P.name] at [COORD(loc)]")
investigate_log("[key_name(P.firer)] triggered a fueltank explosion with [P.name] at [COORD(loc)]", INVESTIGATE_BOMB)
..()
if(!QDELETED(src)) //wasn't deleted by the projectile's effects.
if(!P.nodamage && ((P.damage_type == BURN) || (P.damage_type == BRUTE)))
add_attack_logs(P.firer, src, "shot with [P.name]", ATKLOG_FEW)
log_game("[key_name(P.firer)] triggered a fueltank explosion with [P.name] at [COORD(loc)]")
investigate_log("[key_name(P.firer)] triggered a fueltank explosion with [P.name] at [COORD(loc)]", INVESTIGATE_BOMB)
boom()
/obj/structure/reagent_dispensers/fueltank/do_boom(rigtrigger = FALSE, log_attack = FALSE) // Prevent case where someone who rigged the tank is blamed for the explosion when the rig isn't what triggered the explosion
if(rigtrigger) // If the explosion is triggered by an assembly holder