mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-14 09:35:30 +01:00
Welding Fuel Tanks now log_bomber when hit by projectile (#75885)
## About The Pull Request This was intended behavior, but I think a lot of bullshit over the years sorta corrupted this proc's intention. Anyways, we just override the whole ass proc for this one check, give a good return value (or at least the same one that we were always giving) if our criteria is met, rather than deal with the problems that parent was feeding us.  The specific issue here was that the parent of `bullet_act()` was invoking `take_damage()` which prematurely invoked `boom()` which invokes `qdel()`, meaning that the `QDELETED()` check would _always_ early return without fail every time. Let's just do our own thing here. ## Why It's Good For The Game  Intended behavior actually works. ## Changelog 🆑 admin: Shooting a welding fuel tank (big or small) with a projectile will now accurately post to list_bombers with the name of the person who shot the projectile from the gun. If you don't know how to list-bombers, it will also be present in game.log for your viewing pleasure. /🆑
This commit is contained in:
@@ -155,6 +155,8 @@
|
||||
* Other dispensers will scatter their contents within range.
|
||||
*/
|
||||
/obj/structure/reagent_dispensers/proc/boom()
|
||||
if(QDELETED(src))
|
||||
return // little bit of sanity sauce before we wreck ourselves somehow
|
||||
var/datum/reagent/fuel/volatiles = reagents.has_reagent(/datum/reagent/fuel)
|
||||
var/fuel_amt = 0
|
||||
if(istype(volatiles) && volatiles.volume >= 25)
|
||||
@@ -264,14 +266,15 @@
|
||||
if(ZAP_OBJ_DAMAGE & zap_flags)
|
||||
boom()
|
||||
|
||||
/obj/structure/reagent_dispensers/fueltank/bullet_act(obj/projectile/P)
|
||||
. = ..()
|
||||
if(QDELETED(src)) //wasn't deleted by the projectile's effects.
|
||||
return
|
||||
|
||||
if(P.damage > 0 && ((P.damage_type == BURN) || (P.damage_type == BRUTE)))
|
||||
log_bomber(P.firer, "detonated a", src, "via projectile")
|
||||
/obj/structure/reagent_dispensers/fueltank/bullet_act(obj/projectile/hitting_projectile)
|
||||
if(hitting_projectile.damage > 0 && ((hitting_projectile.damage_type == BURN) || (hitting_projectile.damage_type == BRUTE)))
|
||||
log_bomber(hitting_projectile.firer, "detonated a", src, "via projectile")
|
||||
boom()
|
||||
return hitting_projectile.on_hit(src, 0)
|
||||
|
||||
// we override parent like this because otherwise we won't actually properly log the fact that a projectile caused this welding tank to explode.
|
||||
// if this sucks, feel free to change it, but make sure the damn thing will log. thanks.
|
||||
return ..()
|
||||
|
||||
/obj/structure/reagent_dispensers/fueltank/attackby(obj/item/I, mob/living/user, params)
|
||||
if(I.tool_behaviour == TOOL_WELDER)
|
||||
|
||||
Reference in New Issue
Block a user