From 89cf1ba43f842a106d4a3d263124fbb18cf738ac Mon Sep 17 00:00:00 2001 From: ZomgPonies Date: Sat, 14 Dec 2013 06:08:55 -0500 Subject: [PATCH] Alien runtime fixes --- code/__HELPERS/game.dm | 2 +- code/modules/mob/living/carbon/alien/alien.dm | 10 +++++++++- .../mob/living/carbon/alien/special/alien_embryo.dm | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 80f1fd4b8bc..763c6136a9f 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -302,7 +302,7 @@ proc/isInSight(var/atom/A, var/atom/B) var/i = 0 while(candidates.len <= 0 && i < 5) for(var/mob/G in respawnable_list) - if(G.client.prefs.be_special & BE_ALIEN) + if( G.client && G.client.prefs.be_special & BE_ALIEN) if(((G.client.inactivity/10)/60) <= ALIEN_SELECT_AFK_BUFFER + i) // the most active players are more likely to become an alien if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD)) candidates += G.key diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index c199ba06791..b45429d4586 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -32,7 +32,7 @@ /mob/living/carbon/alien/adjustToxLoss(amount) storedPlasma = min(max(storedPlasma + amount,0),max_plasma) //upper limit of max_plasma, lower limit of 0 - hud_used.alien_plasma_display.maptext = "
[storedPlasma]
" + updatePlasmaDisplay() return /mob/living/carbon/alien/adjustFireLoss(amount) // Weak to Fire @@ -214,3 +214,11 @@ Des: Removes all infected images from the alien. #undef HEAT_DAMAGE_LEVEL_1 #undef HEAT_DAMAGE_LEVEL_2 #undef HEAT_DAMAGE_LEVEL_3 + + +/mob/living/carbon/alien/proc/updatePlasmaDisplay() + if(hud_used) //clientless aliens + hud_used.alien_plasma_display.maptext = "
[storedPlasma]
" + +/mob/living/carbon/alien/larva/updatePlasmaDisplay() + return \ No newline at end of file diff --git a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm index 784d65282d0..c483c1e485a 100644 --- a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm +++ b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm @@ -80,7 +80,7 @@ // he will become the alien but if he doesn't then we will set the stage // to 2, so we don't do a process heavy check everytime. - if(candidates.len) + if(candidates && candidates.len) picked = pick(candidates) else if(affected_mob.client) picked = affected_mob.key