Small QOL improvement for (bluespace) light replacers (#23826)

* Neat

* Update code/game/objects/items/devices/lightreplacer.dm

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

* Update code/game/objects/items/devices/lightreplacer.dm

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

* Lewc review

---------

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
This commit is contained in:
DGamerL
2024-01-25 15:18:47 -05:00
committed by GitHub
co-authored by Contrabang
parent 6a11049bca
commit 80f6170270
@@ -227,17 +227,18 @@
else
return 0
/obj/item/lightreplacer/afterattack(atom/T, mob/U, proximity)
/obj/item/lightreplacer/afterattack(atom/target_turf, mob/U, proximity)
. = ..()
if(!proximity && !bluespace_toggle)
return
if(!isturf(T))
var/turf/replace_turf = get_turf(target_turf)
if(!istype(replace_turf))
return
if(get_dist(src, T) >= (U.client.maxview() + 2)) // To prevent people from using it over cameras
if(get_dist(src, target_turf) >= (U.client.maxview() + 2)) // To prevent people from using it over cameras
return
var/used = FALSE
for(var/atom/A in T)
for(var/atom/A in replace_turf)
if(!CanUse(U))
break
used = TRUE