From 4b04ccb05dd35941aa251e4e89fed4fc772c9d3b Mon Sep 17 00:00:00 2001 From: Chinsky Date: Fri, 5 Jun 2015 11:18:07 +0300 Subject: [PATCH] Axed couple unused organ flags, made them look a bit nicer with bitmove --- code/__defines/damage_organs.dm | 21 +++++++++------------ code/modules/organs/organ.dm | 1 - code/modules/organs/organ_external.dm | 6 +++--- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/code/__defines/damage_organs.dm b/code/__defines/damage_organs.dm index 964ff70a0a..6c2590f840 100644 --- a/code/__defines/damage_organs.dm +++ b/code/__defines/damage_organs.dm @@ -30,18 +30,15 @@ #define AIR_DAMAGE_MODIFIER 2.025 // More means less damage from hot air scalding lungs, less = more damage. (default 2.025) // Organ defines. -#define ORGAN_CUT_AWAY 1 -#define ORGAN_GAUZED 2 -#define ORGAN_ATTACHABLE 4 -#define ORGAN_BLEEDING 8 -#define ORGAN_BROKEN 32 -#define ORGAN_DESTROYED 64 -#define ORGAN_ROBOT 128 -#define ORGAN_SPLINTED 256 -#define SALVED 512 -#define ORGAN_DEAD 1024 -#define ORGAN_MUTATED 2048 -#define ORGAN_ASSISTED 4096 +#define ORGAN_CUT_AWAY 1<<0 +#define ORGAN_BLEEDING 1<<1 +#define ORGAN_BROKEN 1<<2 +#define ORGAN_DESTROYED 1<<3 +#define ORGAN_ROBOT 1<<4 +#define ORGAN_SPLINTED 1<<5 +#define ORGAN_DEAD 1<<6 +#define ORGAN_MUTATED 1<<7 +#define ORGAN_ASSISTED 1<<8 #define DROPLIMB_EDGE 0 #define DROPLIMB_BLUNT 1 diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 038a350fb5..d725937f08 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -217,7 +217,6 @@ var/list/organ_cache = list() src.status &= ~ORGAN_BLEEDING src.status &= ~ORGAN_SPLINTED src.status &= ~ORGAN_CUT_AWAY - src.status &= ~ORGAN_ATTACHABLE src.status &= ~ORGAN_DESTROYED src.status |= ORGAN_ROBOT src.status |= ORGAN_ASSISTED diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index b7541153a5..3dd37a3b5e 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -392,7 +392,7 @@ This function completely restores a damaged organ to perfect condition. //Determines if we even need to process this organ. /obj/item/organ/external/proc/need_process() - if(status & (ORGAN_CUT_AWAY|ORGAN_GAUZED|ORGAN_BLEEDING|ORGAN_BROKEN|ORGAN_DESTROYED|ORGAN_SPLINTED|ORGAN_DEAD|ORGAN_MUTATED)) + if(status & (ORGAN_CUT_AWAY|ORGAN_BLEEDING|ORGAN_BROKEN|ORGAN_DESTROYED|ORGAN_SPLINTED|ORGAN_DEAD|ORGAN_MUTATED)) return 1 if(brute_dam || burn_dam) return 1 @@ -613,7 +613,7 @@ Note that amputating the affected organ does in fact remove the infection from t //things tend to bleed if they are CUT OPEN if (open && !clamped && (H && !(H.species.flags & NO_BLOOD))) status |= ORGAN_BLEEDING - + //Bone fractures if(config.bones_can_break && brute_dam > min_broken_damage * config.organ_health_multiplier && !(status & ORGAN_ROBOT)) src.fracture() @@ -908,7 +908,7 @@ Note that amputating the affected organ does in fact remove the infection from t /obj/item/organ/external/proc/is_usable() if((status & ORGAN_ROBOT) && get_damage() >= max_damage) //robot limbs just become inoperable at max damage - return + return return !is_dislocated() && !(status & (ORGAN_DESTROYED|ORGAN_MUTATED|ORGAN_DEAD)) /obj/item/organ/external/proc/is_malfunctioning()