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)