From dc7edcca95f5ccc0031c4375ab8657acacbb590c Mon Sep 17 00:00:00 2001 From: AnturK Date: Sun, 15 Jul 2018 02:29:57 +0200 Subject: [PATCH] Some A* and medbot sanity. (#39104) * Adds some missing astar sanity. * Also fixes where this came from. * Actually let's notify when someone does something dumb like this. --- code/__HELPERS/AStar.dm | 5 ++++- code/modules/mob/living/simple_animal/bot/medbot.dm | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/code/__HELPERS/AStar.dm b/code/__HELPERS/AStar.dm index c038e2e2e2e..5e03d9b3507 100644 --- a/code/__HELPERS/AStar.dm +++ b/code/__HELPERS/AStar.dm @@ -101,7 +101,10 @@ Actual Adjacent procs : //sanitation var/turf/end = get_turf(_end) var/turf/start = get_turf(caller) - if((!start)||(start.z != end.z)||(start == end)) //no pathfinding between z levels + if(!start || !end) + stack_trace("Invalid A* start or destination") + return 0 + if( start.z != end.z || start == end ) //no pathfinding between z levels return 0 if(maxnodes) //if start turf is farther than maxnodes from end turf, no need to do anything diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm index 5e05a9cbd45..35f1d266f69 100644 --- a/code/modules/mob/living/simple_animal/bot/medbot.dm +++ b/code/modules/mob/living/simple_animal/bot/medbot.dm @@ -287,7 +287,7 @@ oldpatient = patient soft_reset() - if(!patient) + if(QDELETED(patient)) if(!shut_up && prob(1)) var/list/messagevoice = list("Radar, put a mask on!" = 'sound/voice/mradar.ogg',"There's always a catch, and I'm the best there is." = 'sound/voice/mcatch.ogg',"I knew it, I should've been a plastic surgeon." = 'sound/voice/msurgeon.ogg',"What kind of medbay is this? Everyone's dropping like flies." = 'sound/voice/mflies.ogg',"Delicious!" = 'sound/voice/mdelicious.ogg') var/message = pick(messagevoice)