Fix explosive lances not being explosive (#41466)

This commit is contained in:
MrDoomBringer
2018-11-17 11:47:41 -08:00
committed by Tad Hardesty
parent caf4c27940
commit cefd802dc8
+3 -15
View File
@@ -490,13 +490,6 @@
/obj/item/twohanded/spear/update_icon()
icon_state = "[icon_prefix][wielded]"
/obj/item/twohanded/spear/afterattack(atom/movable/AM, mob/user, proximity)
. = ..()
if(!proximity)
return
if(isopenturf(AM)) //So you can actually melee with it
return
/obj/item/twohanded/spear/CheckParts(list/parts_list)
var/obj/item/shard/tip = locate() in parts_list
if (istype(tip, /obj/item/shard/plasma))
@@ -506,13 +499,6 @@
icon_prefix = "spearplasma"
update_icon()
qdel(tip)
var/obj/item/twohanded/spear/S = locate() in parts_list
if(S)
if (istype(S, /obj/item/twohanded/spear/explosive))
var/obj/item/twohanded/spear/explosive/lance = S
lance.explosive.forceMove(get_turf(src)) //Sanity check. This shouldn't really happen, as explosive lances are blacklisted from spear construction.
parts_list -= S
qdel(S)
var/obj/item/grenade/G = locate() in parts_list
if(G)
var/obj/item/twohanded/spear/explosive/lance = new /obj/item/twohanded/spear/explosive(src.loc, G)
@@ -520,6 +506,7 @@
lance.force_unwielded = force_unwielded
lance.throwforce = throwforce
lance.icon_prefix = icon_prefix
parts_list -= G
qdel(src)
..()
@@ -531,7 +518,7 @@
/obj/item/twohanded/spear/explosive/Initialize(mapload, obj/item/grenade/G)
. = ..()
if (!G)
G = new() //For admin-spawned explosive lances
G = new /obj/item/grenade/iedcasing() //For admin-spawned explosive lances
G.forceMove(src)
explosive = G
@@ -558,6 +545,7 @@
/obj/item/twohanded/spear/explosive/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
. = ..()
if(!.) //not caught
explosive.forceMove(get_turf(src))
explosive.prime()
qdel(src)