From 4823570c908d555b73f87c707725dce5c378f5f5 Mon Sep 17 00:00:00 2001 From: AzuleUtama <44248086+AzuleUtama@users.noreply.github.com> Date: Thu, 24 Jan 2019 17:33:45 +0000 Subject: [PATCH 1/2] C4 now applies ex_act to objects. --- code/game/objects/items/weapons/explosives.dm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm index 7cd72bdcb4f..4ac20865500 100644 --- a/code/game/objects/items/weapons/explosives.dm +++ b/code/game/objects/items/weapons/explosives.dm @@ -135,13 +135,16 @@ var/turf/location if(target) if(!QDELETED(target)) - location = get_turf(target) - target.overlays -= image_overlay + if(istype(target, /obj/)) + location = get_atom_on_turf(target) + else + location = get_turf(target) + target.overlays -= image_overlay else location = get_turf(src) if(location) - location.ex_act(2, target) explosion(location,0,0,3) + location.ex_act(2, target) if(istype(target, /mob)) var/mob/M = target M.gib() From 11b213d2a6d2be5deea8ffbb1d57eccd3677a715 Mon Sep 17 00:00:00 2001 From: AzuleUtama <44248086+AzuleUtama@users.noreply.github.com> Date: Thu, 24 Jan 2019 21:05:27 +0000 Subject: [PATCH 2/2] Tweaked --- code/game/objects/items/weapons/explosives.dm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm index 4ac20865500..be490d29065 100644 --- a/code/game/objects/items/weapons/explosives.dm +++ b/code/game/objects/items/weapons/explosives.dm @@ -135,13 +135,13 @@ var/turf/location if(target) if(!QDELETED(target)) - if(istype(target, /obj/)) - location = get_atom_on_turf(target) + if(istype(target, /turf/)) + location = get_turf(target) // Set the explosion location to turf if planted directly on a wall or floor else - location = get_turf(target) - target.overlays -= image_overlay + location = get_atom_on_turf(target) // Otherwise, make sure we're blowing up what's on top of the turf + target.overlays -= image_overlay else - location = get_turf(src) + location = get_atom_on_turf(src) if(location) explosion(location,0,0,3) location.ex_act(2, target) @@ -165,10 +165,13 @@ var/turf/location if(target) if(!QDELETED(target)) - location = get_turf(target) + if(istype(target, /turf/)) + location = get_turf(target) + else + location = get_atom_on_turf(target) target.overlays -= image_overlay else - location = get_turf(src) + location = get_atom_on_turf(src) if(location) if(target && target.density) var/turf/T = get_step(location, aim_dir)