From 795fcd63061c0f787fa74cad2777aff24b2be4fb Mon Sep 17 00:00:00 2001 From: Neerti Date: Sat, 24 Jun 2017 18:18:10 -0400 Subject: [PATCH] Fixes Inability to use Say/LOOC/Other Things A null entry somehow got into ```player_list```, which caused an important proc called ```get_mobs_and_objs_in_view_fast()``` to fail. The cause appeared to be a brain mob failing to qdel, then failing to ```logout()```, leaving a null entry in ```player_list```. ```get_mobs_and_objs_in_view_fast()``` now makes sure every entry it iterates over exists, and this should fix the qdel issue as well. --- code/_helpers/game.dm | 5 ++++- code/modules/mob/living/carbon/brain/brain.dm | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/code/_helpers/game.dm b/code/_helpers/game.dm index d7ee78ff8f..ddcae4980b 100644 --- a/code/_helpers/game.dm +++ b/code/_helpers/game.dm @@ -281,12 +281,15 @@ //A list of every mob with a client for(var/mob in player_list) + if(!istype(mob, /mob)) + crash_with("There is a null or non-mob reference inside player_list.") + continue if(get_turf(mob) in hearturfs) mobs |= mob continue var/mob/M = mob - if(M.stat == DEAD && !M.forbid_seeing_deadchat) + if(M && M.stat == DEAD && !M.forbid_seeing_deadchat) switch(type) if(1) //Audio messages use ghost_ears if(M.is_preference_enabled(/datum/client_preference/ghost_ears)) diff --git a/code/modules/mob/living/carbon/brain/brain.dm b/code/modules/mob/living/carbon/brain/brain.dm index 0f4db8c1eb..2905b4fe4d 100644 --- a/code/modules/mob/living/carbon/brain/brain.dm +++ b/code/modules/mob/living/carbon/brain/brain.dm @@ -20,7 +20,7 @@ if(stat!=DEAD) //If not dead. death(1) //Brains can die again. AND THEY SHOULD AHA HA HA HA HA HA ghostize() //Ghostize checks for key so nothing else is necessary. - ..() + return ..() say_understands(var/other)//Goddamn is this hackish, but this say code is so odd if (istype(other, /mob/living/silicon/ai))