Fixes mobs being unable to hear from inside machines or objects. (#14823)

This commit is contained in:
Matt Atlas
2022-09-16 15:29:31 +02:00
committed by GitHub
parent bf9dca275d
commit 640682ffaf
18 changed files with 168 additions and 120 deletions
-41
View File
@@ -493,47 +493,6 @@
log_admin("[key_name(usr)] forced [key_name(M)] to say: [speech]",admin_key=key_name(usr))
message_admins("<span class='notice'>[key_name_admin(usr)] forced [key_name_admin(M)] to say: [speech]</span>")
else if(href_list["sendtoprison"])
if(!check_rights(R_ADMIN)) return
if(alert(usr, "Send to admin prison for the round?", "Message", "Yes", "No") != "Yes")
return
var/mob/M = locate(href_list["sendtoprison"])
if(!ismob(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
if(istype(M, /mob/living/silicon/ai))
to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai")
return
var/turf/prison_cell = pick(prisonwarp)
if(!prison_cell) return
var/obj/structure/closet/secure_closet/brig/locker = new /obj/structure/closet/secure_closet/brig(prison_cell)
locker.opened = 0
locker.locked = 1
//strip their stuff and stick it in the crate
for(var/obj/item/I in M)
M.drop_from_inventory(I, locker)
M.update_icon()
//so they black out before warping
M.Paralyse(5)
sleep(5)
if(!M) return
M.forceMove(prison_cell)
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/prisoner = M
prisoner.equip_to_slot_or_del(new /obj/item/clothing/under/color/orange(prisoner), slot_w_uniform)
prisoner.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(prisoner), slot_shoes)
to_chat(M, "<span class='warning'>You have been sent to the prison station!</span>")
log_admin("[key_name(usr)] sent [key_name(M)] to the prison station.",,admin_key=key_name(usr),ckey=key_name(M))
message_admins("<span class='notice'>[key_name_admin(usr)] sent [key_name_admin(M)] to the prison station.</span>", 1)
else if(href_list["sendbacktolobby"])
if(!check_rights(R_ADMIN))
return