Fixes germ levels going below zero

This commit is contained in:
mwerezak
2014-07-12 16:18:29 -04:00
parent c0487b9c90
commit 1502799afd
3 changed files with 4 additions and 6 deletions

View File

@@ -21,7 +21,7 @@
/datum/organ/proc/handle_antibiotics()
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
if (antibiotics < 5)
if (!germ_level || antibiotics < 5)
return
if (germ_level < INFECTION_LEVEL_ONE)

View File

@@ -355,7 +355,7 @@ INFECTION_LEVEL_THREE above this germ level the player will take additional toxi
Note that amputating the affected organ does in fact remove the infection from the player's body.
*/
/datum/organ/external/proc/update_germs()
if(status & (ORGAN_ROBOT|ORGAN_DESTROYED) || (owner.species && owner.species.flags & IS_PLANT)) //Robotic limbs shouldn't be infected, nor should nonexistant limbs.
germ_level = 0
return
@@ -387,7 +387,7 @@ Note that amputating the affected organ does in fact remove the infection from t
/datum/organ/external/proc/handle_germ_effects()
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
if (germ_level < INFECTION_LEVEL_ONE && prob(60)) //this could be an else clause, but it looks cleaner this way
if (germ_level > 0 && germ_level < INFECTION_LEVEL_ONE && prob(60)) //this could be an else clause, but it looks cleaner this way
germ_level-- //since germ_level increases at a rate of 1 per second with dirty wounds, prob(60) should give us about 5 minutes before level one.
if(germ_level >= INFECTION_LEVEL_ONE)

View File

@@ -33,8 +33,6 @@
/datum/organ/internal/process()
//Process infections
if (!germ_level)
return
if (robotic >= 2 || (owner.species && owner.species.flags & IS_PLANT)) //TODO make robotic internal and external organs separate types of organ instead of a flag
germ_level = 0
@@ -47,7 +45,7 @@
//** Handle the effects of infections
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
if (germ_level < INFECTION_LEVEL_ONE/2 && prob(30))
if (germ_level > 0 && germ_level < INFECTION_LEVEL_ONE/2 && prob(30))
germ_level--
if (germ_level >= INFECTION_LEVEL_ONE/2)