From e3bd345d666e63cf7eb30e9dc5851f065342bdcd Mon Sep 17 00:00:00 2001 From: Nodrak Date: Sat, 6 Apr 2013 22:42:19 -0400 Subject: [PATCH] Adds a sanity check to turf/proc/distance_cardinal() --- code/game/turfs/turf.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 870278d08ae..f6217985db6 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -298,6 +298,7 @@ // possible. It results in more efficient (CPU-wise) pathing // for bots and anything else that only moves in cardinal dirs. /turf/proc/Distance_cardinal(turf/t) + if(!src || !t) return 0 return abs(src.x - t.x) + abs(src.y - t.y) /turf/proc/AdjacentTurfsSpace()