Fixes locker bolts moving mobs not valid for insertion into lockers. (#43439)

This commit is contained in:
ShizCalev
2019-04-02 16:10:58 -04:00
committed by moo
parent 6f81c4daa5
commit 27c66097c6

View File

@@ -378,15 +378,20 @@
var/weld = TRUE
var/created = FALSE //prevents creation of more then one locker if it has multiple hits
var/locker_suck = TRUE
var/obj/structure/closet/locker_temp_instance = /obj/structure/closet/decay
/obj/item/projectile/magic/locker/Initialize()
. = ..()
locker_temp_instance = new(src)
/obj/item/projectile/magic/locker/prehit(atom/A)
if(ismob(A) && locker_suck)
var/mob/M = A
if(isliving(A) && locker_suck)
var/mob/living/M = A
if(M.anti_magic_check())
M.visible_message("<span class='warning'>[src] vanishes on contact with [A]!</span>")
qdel(src)
return
if(M.anchored)
if(!locker_temp_instance.insertion_allowed(M))
return ..()
M.forceMove(src)
return FALSE
@@ -395,7 +400,7 @@
/obj/item/projectile/magic/locker/on_hit(target)
if(created)
return ..()
var/obj/structure/closet/decay/C = new(get_turf(src))
var/obj/structure/closet/C = new locker_temp_instance(get_turf(src))
if(LAZYLEN(contents))
for(var/atom/movable/AM in contents)
C.insert(AM)