From 4836e9b05746ad00d6aace3ce1e03a9340155d24 Mon Sep 17 00:00:00 2001 From: jupotter Date: Fri, 12 Apr 2013 19:16:08 +0200 Subject: [PATCH 1/2] Fix posibrain not turning off if no candidate The reset proc was checking for the presence of a brainmob, while one was created in the constructor. It should rather check the presence of a key --- code/modules/mob/living/carbon/brain/posibrain.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/brain/posibrain.dm b/code/modules/mob/living/carbon/brain/posibrain.dm index 8ed5860ecf8..761029c7b1f 100644 --- a/code/modules/mob/living/carbon/brain/posibrain.dm +++ b/code/modules/mob/living/carbon/brain/posibrain.dm @@ -65,7 +65,7 @@ proc/reset_search() //We give the players sixty seconds to decide, then reset the timer. - if(brainmob) return + if(src.brainmob.key) return src.searching = 0 icon_state = "posibrain" From a8e1081d9dfa8678af61d4a8f516034e3f190285 Mon Sep 17 00:00:00 2001 From: Jupotter Date: Sat, 13 Apr 2013 11:58:58 +0300 Subject: [PATCH 2/2] Add check forposibrain without brainmob This should never happen, but check nonetheless. --- code/modules/mob/living/carbon/brain/posibrain.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/carbon/brain/posibrain.dm b/code/modules/mob/living/carbon/brain/posibrain.dm index 761029c7b1f..1bc59497ebc 100644 --- a/code/modules/mob/living/carbon/brain/posibrain.dm +++ b/code/modules/mob/living/carbon/brain/posibrain.dm @@ -17,7 +17,7 @@ attack_self(mob/user as mob) - if(!brainmob.key && searching == 0) + if(!brainmob && !brainmob.key && searching == 0) //Start the process of searching for a new user. user << "\blue You carefully locate the manual activation switch and start the positronic brain's boot process." icon_state = "posibrain-searching" @@ -65,7 +65,7 @@ proc/reset_search() //We give the players sixty seconds to decide, then reset the timer. - if(src.brainmob.key) return + if(src.brainmob && src.brainmob.key) return src.searching = 0 icon_state = "posibrain" @@ -86,7 +86,7 @@ var/msg = "*---------*\nThis is \icon[src] \a [src]!\n[desc]\n" msg += "" - if(src.brainmob.key) + if(src.brainmob && src.brainmob.key) switch(src.brainmob.stat) if(CONSCIOUS) if(!src.brainmob.client) msg += "It appears to be in stand-by mode.\n" //afk @@ -124,4 +124,4 @@ src.brainmob.brain_op_stage = 4.0 dead_mob_list -= src.brainmob - ..() \ No newline at end of file + ..()