diff --git a/code/_onclick/adjacent.dm b/code/_onclick/adjacent.dm index fa08ea6f6b..47e7e99a92 100644 --- a/code/_onclick/adjacent.dm +++ b/code/_onclick/adjacent.dm @@ -55,6 +55,21 @@ return 1 // we don't care about our own density return 0 +/* +Quick adjacency (to turf): +* If you are in the same turf, always true +* If you are not adjacent, then false +*/ +/turf/proc/AdjacentQuick(var/atom/neighbor, var/atom/target = null) + var/turf/T0 = get_turf(neighbor) + if(T0 == src) + return 1 + + if(get_dist(src,T0) > 1) + return 0 + + return 1 + /* Adjacency (to anything else): * Must be on a turf diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index fd0b658aa0..2fe09bb3bf 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -245,7 +245,7 @@ /atom/proc/AltClick(var/mob/user) var/turf/T = get_turf(src) - if(T && T.Adjacent(user)) + if(T && T.AdjacentQuick(user)) if(user.listed_turf == T) user.listed_turf = null else