mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-04 06:22:38 +00:00
Changes the arbitrary failure return for surgery from 2 to -1. This is because ORGAN_BLEEDING in damage_organs.dm is now 2 so some statements evaluate to 2, which causes bleeding clamp surgery to fail as it triggered the "This is an error that's already been dealt with" condition coincidentally.
Surgeries which report failures (like trying to stick a brain in someone who's already got one) now throw back a -1 not a 2.
This commit is contained in:
@@ -273,11 +273,11 @@
|
||||
|
||||
if((affected.status & ORGAN_ROBOT) && !(O.status & ORGAN_ROBOT))
|
||||
user << "<span class='danger'>You cannot install a naked organ into a robotic body.</span>"
|
||||
return 2
|
||||
return -1
|
||||
|
||||
if(!target.species)
|
||||
user << "\red You have no idea what species this person is. Report this on the bug tracker."
|
||||
return 2
|
||||
return -1
|
||||
|
||||
var/o_is = (O.gender == PLURAL) ? "are" : "is"
|
||||
var/o_a = (O.gender == PLURAL) ? "" : "a "
|
||||
@@ -289,22 +289,22 @@
|
||||
|
||||
if(O.damage > (O.max_damage * 0.75))
|
||||
user << "\red \The [O.organ_tag] [o_is] in no state to be transplanted."
|
||||
return 2
|
||||
return -1
|
||||
|
||||
if(!target.internal_organs_by_name[O.organ_tag])
|
||||
organ_missing = 1
|
||||
else
|
||||
user << "\red \The [target] already has [o_a][O.organ_tag]."
|
||||
return 2
|
||||
return -1
|
||||
|
||||
if(O && affected.limb_name == O.parent_organ)
|
||||
organ_compatible = 1
|
||||
else
|
||||
user << "\red \The [O.organ_tag] [o_do] normally go in \the [affected.name]."
|
||||
return 2
|
||||
return -1
|
||||
else
|
||||
user << "\red You're pretty sure [target.species.name_plural] don't normally have [o_a][O.organ_tag]."
|
||||
return 2
|
||||
return -1
|
||||
|
||||
return ..() && organ_missing && organ_compatible
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@
|
||||
if(istype(C))
|
||||
if(!C.get_amount() >= 3)
|
||||
user << "<span class='danger'>You need three or more cable pieces to repair this damage.</span>"
|
||||
return 2
|
||||
return -1
|
||||
C.use(3)
|
||||
return 1
|
||||
return 0
|
||||
@@ -383,23 +383,23 @@
|
||||
|
||||
if(!M.brainmob || !M.brainmob.client || !M.brainmob.ckey || M.brainmob.stat >= DEAD)
|
||||
user << "<span class='danger'>That brain is not usable.</span>"
|
||||
return 2
|
||||
return -1
|
||||
|
||||
if(!(affected.status & ORGAN_ROBOT))
|
||||
user << "<span class='danger'>You cannot install a computer brain into a meat skull.</span>"
|
||||
return 2
|
||||
return -1
|
||||
|
||||
if(!target.species)
|
||||
user << "<span class='danger'>You have no idea what species this person is. Report this on the bug tracker.</span>"
|
||||
return 2
|
||||
return -1
|
||||
|
||||
if(!target.species.has_organ["brain"])
|
||||
user << "<span class='danger'>You're pretty sure [target.species.name_plural] don't normally have a brain.</span>"
|
||||
return 2
|
||||
return -1
|
||||
|
||||
if(!isnull(target.internal_organs["brain"]))
|
||||
user << "<span class='danger'>Your subject already has a brain.</span>"
|
||||
return 2
|
||||
return -1
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
@@ -90,8 +90,9 @@ proc/do_surgery(mob/living/carbon/M, mob/living/user, obj/item/tool)
|
||||
//check if tool is right or close enough and if this step is possible
|
||||
if(S.tool_quality(tool))
|
||||
var/step_is_valid = S.can_use(user, M, zone, tool)
|
||||
world.log << "Is Valid = [step_is_valid]"
|
||||
if(step_is_valid && S.is_valid_target(M))
|
||||
if(step_is_valid == 2) // This is a failure that already has a message for failing.
|
||||
if(step_is_valid == -1) // This is a failure that already has a message for failing.
|
||||
return 1
|
||||
M.op_stage.in_progress += zone
|
||||
S.begin_step(user, M, zone, tool) //start on it
|
||||
|
||||
Reference in New Issue
Block a user