Adds another can_inject check just before injecting (#26001)

* Adds another check before injecting/applying medicals stacks

* More helpful comments

* Updates to use extra_checks
This commit is contained in:
4dplanner
2017-04-11 15:25:07 +02:00
committed by AnturK
parent fcfcdf1af1
commit 2f1f0da5be
2 changed files with 3 additions and 4 deletions
+1 -1
View File
@@ -73,7 +73,7 @@
else if(user.gender == FEMALE)
t_himself = "herself"
user.visible_message("<span class='notice'>[user] starts to apply [src] on [t_himself]...</span>", "<span class='notice'>You begin applying [src] on yourself...</span>")
if(!do_mob(user, M, self_delay))
if(!do_mob(user, M, self_delay, extra_checks=CALLBACK(M, /mob/living/proc/can_inject,user,1)))
return
user.visible_message("<span class='green'>[user] applies [src] on [t_himself].</span>", "<span class='green'>You apply [src] on yourself.</span>")
@@ -80,7 +80,7 @@
target.visible_message("<span class='danger'>[user] is trying to take a blood sample from [target]!</span>", \
"<span class='userdanger'>[user] is trying to take a blood sample from [target]!</span>")
busy = 1
if(!do_mob(user, target))
if(!do_mob(user, target, extra_checks=CALLBACK(L, /mob/living/proc/can_inject,user,1)))
busy = 0
return
if(reagents.total_volume >= reagents.maximum_volume)
@@ -123,13 +123,12 @@
if(L != user)
L.visible_message("<span class='danger'>[user] is trying to inject [L]!</span>", \
"<span class='userdanger'>[user] is trying to inject [L]!</span>")
if(!do_mob(user, L))
if(!do_mob(user, L, extra_checks=CALLBACK(L, /mob/living/proc/can_inject,user,1)))
return
if(!reagents.total_volume)
return
if(L.reagents.total_volume >= L.reagents.maximum_volume)
return
L.visible_message("<span class='danger'>[user] injects [L] with the syringe!", \
"<span class='userdanger'>[user] injects [L] with the syringe!")