Skip to content

Commit

Permalink
Small QOL improvement for (bluespace) light replacers (ParadiseSS13#2…
Browse files Browse the repository at this point in the history
…3826)

* Neat

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

Co-authored-by: Contrabang <[email protected]>

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

Co-authored-by: Contrabang <[email protected]>

* Lewc review

---------

Co-authored-by: Contrabang <[email protected]>
  • Loading branch information
DGamerL and Contrabang committed Jan 25, 2024
1 parent 6a11049 commit 80f6170
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions code/game/objects/items/devices/lightreplacer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 80f6170

Please sign in to comment.