Fixes HREF exploit with sleepers (#12947)

* Fixes HREF exploit with sleepers
Fixes HREF exploit with sleepers

* src.author = "DrCelt"
This commit is contained in:
DrCelt
2016-12-28 11:29:12 -08:00
committed by Pieter-Jan Briers
parent efef002c4d
commit 49145337fa

View File

@@ -101,8 +101,7 @@
else
usr.set_machine(src)
if (href_list["chemical"])
if (src.connected)
if (src.connected.occupant)
if (src.connected && src.connected.occupant)
if (src.connected.occupant.stat == DEAD)
to_chat(usr, "<span class='danger'>This person has no life for to preserve anymore. Take them to a department capable of reanimating them.</span>")
else if(href_list["chemical"] == STOXIN && src.connected.sedativeblock)
@@ -122,7 +121,10 @@
else if(src.connected.occupant.health < 0 && href_list["chemical"] != INAPROVALINE)
to_chat(usr, "<span class='danger'>This person is not in good enough condition for sleepers to be effective! Use another means of treatment, such as cryogenics!</span>")
else
src.connected.inject_chemical(usr,href_list["chemical"],text2num(href_list["amount"]))
if(!(href_list["chemical"] in connected.available_options)) //href exploitu go home
to_chat(usr,"<span class='warning'>That's odd. You could've sworn the [href_list["chemical"]] button was there just a second ago!")
else
connected.inject_chemical(usr,href_list["chemical"],text2num(href_list["amount"]))
if (href_list["wakeup"])
connected.wakeup(usr)
if (href_list["toggle_autoeject"])