Makes so that vr chairs don't work without power (#9725)

This commit is contained in:
Alberyk
2020-08-24 08:58:31 -03:00
committed by GitHub
parent 13f303ce81
commit cd55cfd7eb
3 changed files with 31 additions and 0 deletions
@@ -11,6 +11,10 @@
if(portable_type)
name = "portable [name]"
/obj/structure/bed/chair/remote/Destroy()
STOP_PROCESSING(SSprocessing, src)
return ..()
/obj/structure/bed/chair/remote/examine(mob/user)
..()
if(portable_type)
@@ -32,12 +36,25 @@
/obj/structure/bed/chair/remote/user_buckle_mob(mob/user)
..()
var/area/A = get_area(src)
if(!A.powered(EQUIP))
to_chat(user, SPAN_WARNING("\The [src] is not powered."))
return FALSE
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.old_mob)
to_chat(H, SPAN_WARNING("The chair rejects you! You cannot recursively control bodies."))
return
add_overlay(image('icons/obj/furniture.dmi', src, "vr_helmet", MOB_LAYER + 1))
START_PROCESSING(SSprocessing, src)
/obj/structure/bed/chair/remote/process()
..()
if(buckled_mob)
var/area/A = get_area(src)
if(!A.powered(EQUIP))
user_unbuckle_mob(buckled_mob)
// Return to our body in the unfortunate event that we get unbuckled while plugged in
/obj/structure/bed/chair/remote/user_unbuckle_mob(mob/user)
@@ -46,4 +63,5 @@
if(istype(M) && M.vr_mob)
M.vr_mob.body_return()
cut_overlays()
STOP_PROCESSING(SSprocessing, src)
..()