mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Fix medical stack exploit
This commit is contained in:
@@ -24,6 +24,11 @@
|
||||
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
|
||||
return 1
|
||||
|
||||
var/available = get_amount()
|
||||
if(!available)
|
||||
to_chat(user, "<span class='warning'>There's not enough [uses_charge ? "charge" : "items"] left to use that!</span>")
|
||||
return 1
|
||||
|
||||
if (istype(M, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
|
||||
@@ -101,11 +106,12 @@
|
||||
to_chat(user, "<span class='warning'>The wounds on [M]'s [affecting.name] have already been bandaged.</span>")
|
||||
return 1
|
||||
else
|
||||
var/available = get_amount()
|
||||
user.visible_message("<span class='notice'>\The [user] starts bandaging [M]'s [affecting.name].</span>", \
|
||||
"<span class='notice'>You start bandaging [M]'s [affecting.name].</span>" )
|
||||
var/used = 0
|
||||
for (var/datum/wound/W in affecting.wounds)
|
||||
if (W.internal)
|
||||
if(W.internal)
|
||||
continue
|
||||
if(W.bandaged)
|
||||
continue
|
||||
@@ -119,6 +125,10 @@
|
||||
to_chat(user, "<span class='warning'>The wounds on [M]'s [affecting.name] have already been bandaged.</span>")
|
||||
return 1
|
||||
|
||||
if(used >= available)
|
||||
to_chat(user, "<span class='warning'>You run out of [src]!</span>")
|
||||
break
|
||||
|
||||
if (W.current_stage <= W.max_bleeding_stage)
|
||||
user.visible_message("<span class='notice'>\The [user] bandages \a [W.desc] on [M]'s [affecting.name].</span>", \
|
||||
"<span class='notice'>You bandage \a [W.desc] on [M]'s [affecting.name].</span>" )
|
||||
@@ -164,6 +174,7 @@
|
||||
to_chat(user, "<span class='warning'>The wounds on [M]'s [affecting.name] have already been bandaged.</span>")
|
||||
return 1
|
||||
else
|
||||
var/available = get_amount()
|
||||
user.visible_message("<span class='notice'>\The [user] starts treating [M]'s [affecting.name].</span>", \
|
||||
"<span class='notice'>You start treating [M]'s [affecting.name].</span>" )
|
||||
var/used = 0
|
||||
@@ -182,6 +193,10 @@
|
||||
to_chat(user, "<span class='warning'>The wounds on [M]'s [affecting.name] have already been bandaged.</span>")
|
||||
return 1
|
||||
|
||||
if(used >= available)
|
||||
to_chat(user, "<span class='warning'>You run out of [src]!</span>")
|
||||
break
|
||||
|
||||
if (W.current_stage <= W.max_bleeding_stage)
|
||||
user.visible_message("<span class='notice'>\The [user] bandages \a [W.desc] on [M]'s [affecting.name].</span>", \
|
||||
"<span class='notice'>You bandage \a [W.desc] on [M]'s [affecting.name].</span>" )
|
||||
@@ -271,6 +286,7 @@
|
||||
to_chat(user, "<span class='warning'>The wounds on [M]'s [affecting.name] have already been treated.</span>")
|
||||
return 1
|
||||
else
|
||||
var/available = get_amount()
|
||||
user.visible_message("<span class='notice'>\The [user] starts treating [M]'s [affecting.name].</span>", \
|
||||
"<span class='notice'>You start treating [M]'s [affecting.name].</span>" )
|
||||
var/used = 0
|
||||
@@ -287,6 +303,11 @@
|
||||
if(affecting.is_bandaged() && affecting.is_disinfected()) // We do a second check after the delay, in case it was bandaged after the first check.
|
||||
to_chat(user, "<span class='warning'>The wounds on [M]'s [affecting.name] have already been bandaged.</span>")
|
||||
return 1
|
||||
|
||||
if(used >= available)
|
||||
to_chat(user, "<span class='warning'>You run out of [src]!</span>")
|
||||
break
|
||||
|
||||
if (W.current_stage <= W.max_bleeding_stage)
|
||||
user.visible_message("<span class='notice'>\The [user] cleans \a [W.desc] on [M]'s [affecting.name] and seals the edges with bioglue.</span>", \
|
||||
"<span class='notice'>You clean and seal \a [W.desc] on [M]'s [affecting.name].</span>" )
|
||||
|
||||
Reference in New Issue
Block a user