mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Added a quick adjacent check for alt-clicking
Since we really don't need to be doing a pathing check when we just want to return an object list.
This commit is contained in:
@@ -55,6 +55,21 @@
|
|||||||
return 1 // we don't care about our own density
|
return 1 // we don't care about our own density
|
||||||
return 0
|
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):
|
Adjacency (to anything else):
|
||||||
* Must be on a turf
|
* Must be on a turf
|
||||||
|
|||||||
@@ -245,7 +245,7 @@
|
|||||||
|
|
||||||
/atom/proc/AltClick(var/mob/user)
|
/atom/proc/AltClick(var/mob/user)
|
||||||
var/turf/T = get_turf(src)
|
var/turf/T = get_turf(src)
|
||||||
if(T && T.Adjacent(user))
|
if(T && T.AdjacentQuick(user))
|
||||||
if(user.listed_turf == T)
|
if(user.listed_turf == T)
|
||||||
user.listed_turf = null
|
user.listed_turf = null
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user