Prevents exosuit sleepers from loading buckled people (#17327)

* sdafa

* sdfa
This commit is contained in:
Fluffy
2023-09-13 10:19:31 +00:00
committed by GitHub
parent baf4f607dd
commit eb013b2537
2 changed files with 63 additions and 6 deletions
@@ -37,12 +37,27 @@
/obj/item/mecha_equipment/sleeper/afterattack(var/atom/target, var/mob/living/user, var/inrange, var/params)
. = ..()
if(.)
if(ishuman(target) && !sleeper.occupant)
visible_message("<span class='notice'>\The [src] begins loading \the [target] into \the [src].</span>")
sleeper.go_in(target, user)
else
to_chat(user, "<span class='warning'>You cannot load that in!</span>")
if(!.)
return
//Check it's a person and typecast if so
if(!ishuman(target))
return
var/mob/living/carbon/human/person_to_load = target
//Check that the person is not buckled
if(person_to_load.buckled_to)
to_chat(SPAN_WARNING("You must unbuckle [person_to_load] before loading!"))
return
//Check that the sleeper isn't already occupied
if(sleeper.occupant)
to_chat(user, SPAN_WARNING("The sleeper is already occupied!"))
return
//All good, load the person
visible_message("<span class='notice'>\The [src] begins loading \the [target] into \the [src].</span>")
sleeper.go_in(person_to_load, user)
/obj/item/mecha_equipment/sleeper/get_hardpoint_maptext()
if(sleeper && sleeper.occupant)