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,28 +101,30 @@
else else
usr.set_machine(src) usr.set_machine(src)
if (href_list["chemical"]) if (href_list["chemical"])
if (src.connected) if (src.connected && src.connected.occupant)
if (src.connected.occupant) if (src.connected.occupant.stat == DEAD)
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>")
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)
else if(href_list["chemical"] == STOXIN && src.connected.sedativeblock) if(src.connected.sedativeblock < 3)
if(src.connected.sedativeblock < 3) to_chat(usr, "<span class='warning'>Sedative injections not yet ready. Please try again in a few seconds.</span>")
to_chat(usr, "<span class='warning'>Sedative injections not yet ready. Please try again in a few seconds.</span>") else //if this guy is seriously just mashing the soporific button...
else //if this guy is seriously just mashing the soporific button... to_chat(usr, "[pick( \
to_chat(usr, "[pick( \ "<span class='warning'>This guy just got jammed into the machine, give them a breath before trying to pump them full of drugs.</span>", \
"<span class='warning'>This guy just got jammed into the machine, give them a breath before trying to pump them full of drugs.</span>", \ "<span class='warning'>Give it a rest.</span>", \
"<span class='warning'>Give it a rest.</span>", \ "<span class='warning'>Aren't you going to tuck them in before putting them to sleep?</span>", \
"<span class='warning'>Aren't you going to tuck them in before putting them to sleep?</span>", \ "<span class='warning'>Slow down just a second, they aren't going anywhere... right?</span>", \
"<span class='warning'>Slow down just a second, they aren't going anywhere... right?</span>", \ "<span class='warning'>Just got to make sure you're not tripping the fuck out of an innocent bystander, stay tight.</span>", \
"<span class='warning'>Just got to make sure you're not tripping the fuck out of an innocent bystander, stay tight.</span>", \ "<span class='warning'>The occupant is still moving around!</span>", \
"<span class='warning'>The occupant is still moving around!</span>", \ "<span class='warning'>Sorry pal, safety procedures.</span>", \
"<span class='warning'>Sorry pal, safety procedures.</span>", \ "<span class='warning'>But it's not bedtime yet!</span>")]")
"<span class='warning'>But it's not bedtime yet!</span>")]") src.connected.sedativeblock++
src.connected.sedativeblock++ else if(src.connected.occupant.health < 0 && href_list["chemical"] != INAPROVALINE)
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>")
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
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 else
src.connected.inject_chemical(usr,href_list["chemical"],text2num(href_list["amount"])) connected.inject_chemical(usr,href_list["chemical"],text2num(href_list["amount"]))
if (href_list["wakeup"]) if (href_list["wakeup"])
connected.wakeup(usr) connected.wakeup(usr)
if (href_list["toggle_autoeject"]) if (href_list["toggle_autoeject"])