From 4bccb8612a70b74149d1adf3f8a230a9a96548b0 Mon Sep 17 00:00:00 2001 From: "elly1989@rocketmail.com" Date: Mon, 16 Apr 2012 21:55:51 +0000 Subject: [PATCH] Fixes server-crashing runtimes that would happen when badmins deleted all hud items. These bugs account for half of the runtime log. This would have been a lot easier with admin cooperation. TODO: make some sort of failsafe so stupid stuff like this doesn't happen git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3473 316c924e-a436-60f5-8080-3fe189b3f50e --- code/modules/mob/living/carbon/human/life.dm | 46 +++++++++---------- code/modules/mob/living/carbon/monkey/life.dm | 40 ++++++++-------- code/modules/mob/living/silicon/ai/life.dm | 9 ++-- code/modules/mob/living/silicon/robot/life.dm | 24 +++++----- 4 files changed, 60 insertions(+), 59 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index a74d814447a..d577209da5e 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -987,35 +987,35 @@ if(pullin) pullin.icon_state = "pull[pulling ? 1 : 0]" - if(resting || lying || sleeping) rest.icon_state = "rest[(resting || lying || sleeping) ? 1 : 0]" + if(rest) rest.icon_state = "rest[(resting || lying || sleeping) ? 1 : 0]" if (toxin || hal_screwyhud == 4) toxin.icon_state = "tox[toxins_alert ? 1 : 0]" - if (oxygen || hal_screwyhud == 3) oxygen.icon_state = "oxy[oxygen_alert ? 1 : 0]" - if (fire) fire.icon_state = "fire[fire_alert ? 1 : 0]" + if (oxygen || hal_screwyhud == 3) oxygen.icon_state = "oxy[oxygen_alert ? 1 : 0]" + if (fire) fire.icon_state = "fire[fire_alert ? 1 : 0]" //NOTE: INVESTIGATE NUKE BURNINGS //NOTE: the alerts dont reset when youre out of danger. dont blame me, //blame the person who coded them. Temporary fix added. - switch(bodytemperature) //310.055 optimal body temp - - if(370 to INFINITY) - bodytemp.icon_state = "temp4" - if(350 to 370) - bodytemp.icon_state = "temp3" - if(335 to 350) - bodytemp.icon_state = "temp2" - if(320 to 335) - bodytemp.icon_state = "temp1" - if(300 to 320) - bodytemp.icon_state = "temp0" - if(295 to 300) - bodytemp.icon_state = "temp-1" - if(280 to 295) - bodytemp.icon_state = "temp-2" - if(260 to 280) - bodytemp.icon_state = "temp-3" - else - bodytemp.icon_state = "temp-4" + if(bodytemp) + switch(bodytemperature) //310.055 optimal body temp + if(370 to INFINITY) + bodytemp.icon_state = "temp4" + if(350 to 370) + bodytemp.icon_state = "temp3" + if(335 to 350) + bodytemp.icon_state = "temp2" + if(320 to 335) + bodytemp.icon_state = "temp1" + if(300 to 320) + bodytemp.icon_state = "temp0" + if(295 to 300) + bodytemp.icon_state = "temp-1" + if(280 to 295) + bodytemp.icon_state = "temp-2" + if(260 to 280) + bodytemp.icon_state = "temp-3" + else + bodytemp.icon_state = "temp-4" if(!client) return 0 //Wish we did not need these client.screen -= hud_used.blurry diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index d12c4e6b365..375445f7b1d 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -566,26 +566,26 @@ //NOTE: the alerts dont reset when youre out of danger. dont blame me, //blame the person who coded them. Temporary fix added. - switch(src.bodytemperature) //310.055 optimal body temp - - if(345 to INFINITY) - src.bodytemp.icon_state = "temp4" - if(335 to 345) - src.bodytemp.icon_state = "temp3" - if(327 to 335) - src.bodytemp.icon_state = "temp2" - if(316 to 327) - src.bodytemp.icon_state = "temp1" - if(300 to 316) - src.bodytemp.icon_state = "temp0" - if(295 to 300) - src.bodytemp.icon_state = "temp-1" - if(280 to 295) - src.bodytemp.icon_state = "temp-2" - if(260 to 280) - src.bodytemp.icon_state = "temp-3" - else - src.bodytemp.icon_state = "temp-4" + if(bodytemp) + switch(src.bodytemperature) //310.055 optimal body temp + if(345 to INFINITY) + src.bodytemp.icon_state = "temp4" + if(335 to 345) + src.bodytemp.icon_state = "temp3" + if(327 to 335) + src.bodytemp.icon_state = "temp2" + if(316 to 327) + src.bodytemp.icon_state = "temp1" + if(300 to 316) + src.bodytemp.icon_state = "temp0" + if(295 to 300) + src.bodytemp.icon_state = "temp-1" + if(280 to 295) + src.bodytemp.icon_state = "temp-2" + if(260 to 280) + src.bodytemp.icon_state = "temp-3" + else + src.bodytemp.icon_state = "temp-4" src.client.screen -= src.hud_used.blurry src.client.screen -= src.hud_used.druggy diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index 3fbbb850293..7e3559d58fa 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -47,10 +47,11 @@ //stage = 5 blind = 1 - if (!blind) + if (!blind) //lol? if(!blind) #if(src.blind.layer) <--something here is clearly wrong :P + //I'll get back to this when I find out how this is -supposed- to work ~Carn //stage = 4.5 - if (src.blind.layer!=0) - src.blind.layer = 0 +// if (src.blind.layer!=0) +// src.blind.layer = 0 src.sight |= SEE_TURFS src.sight |= SEE_MOBS src.sight |= SEE_OBJS @@ -58,7 +59,7 @@ src.see_invisible = 2 var/area/home = get_area(src) - if(!home) return//something to do with malf fucking things up I guess. + if(!home) return//something to do with malf fucking things up I guess. <-- aisat is gone. is this still necessary? ~Carn if(home.powered(EQUIP)) home.use_power(1000, EQUIP) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index ed41014c0de..fce01a92b46 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -236,18 +236,18 @@ else src.cells.icon_state = "charge-empty" - switch(src.bodytemperature) //310.055 optimal body temp - - if(335 to INFINITY) - src.bodytemp.icon_state = "temp2" - if(320 to 335) - src.bodytemp.icon_state = "temp1" - if(300 to 320) - src.bodytemp.icon_state = "temp0" - if(260 to 300) - src.bodytemp.icon_state = "temp-1" - else - src.bodytemp.icon_state = "temp-2" + if(bodytemp) + switch(src.bodytemperature) //310.055 optimal body temp + if(335 to INFINITY) + src.bodytemp.icon_state = "temp2" + if(320 to 335) + src.bodytemp.icon_state = "temp1" + if(300 to 320) + src.bodytemp.icon_state = "temp0" + if(260 to 300) + src.bodytemp.icon_state = "temp-1" + else + src.bodytemp.icon_state = "temp-2" if(src.pullin) src.pullin.icon_state = "pull[src.pulling ? 1 : 0]"