Alien runtime fixes

This commit is contained in:
ZomgPonies
2013-12-14 06:08:55 -05:00
parent 12b8ae8d76
commit 89cf1ba43f
3 changed files with 11 additions and 3 deletions
+1 -1
View File
@@ -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
@@ -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 = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'> <font color='magenta'>[storedPlasma]</font></div>"
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 = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'> <font color='magenta'>[storedPlasma]</font></div>"
/mob/living/carbon/alien/larva/updatePlasmaDisplay()
return
@@ -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