Pointing decals now delete themselves properly (#13198)

This commit is contained in:
mikomyazaki
2022-02-16 19:46:53 +01:00
committed by GitHub
parent a5c6edc22e
commit d4e29ae4ee
3 changed files with 28 additions and 34 deletions
+17 -16
View File
@@ -333,26 +333,27 @@
set name = "Point To"
set category = "Object"
if(!src || !isturf(src.loc) || !(A in range(world.view, get_turf(src))))
return 0
if(istype(A, /obj/effect/decal/point) || pointing_effect)
return 0
var/tile = get_turf(A)
if (!tile)
return 0
pointing_effect = new /obj/effect/decal/point(tile)
pointing_effect.invisibility = invisibility
addtimer(CALLBACK(.proc/end_pointing_effect), 2 SECONDS)
if(!isturf(src.loc) || !(A in range(world.view, get_turf(src))))
return FALSE
if(next_point_time >= world.time)
return FALSE
next_point_time = world.time + 25
face_atom(A)
return 1
if(isturf(A))
if(pointing_effect)
end_pointing_effect()
pointing_effect = new /obj/effect/decal/point(A)
pointing_effect.invisibility = invisibility
addtimer(CALLBACK(src, .proc/end_pointing_effect, pointing_effect), 2 SECONDS)
else
var/atom/movable/M = A
M.add_filter("pointglow", 1, list(type = "drop_shadow", x = 0, y = -1, offset = 1, size = 1, color = "#F00"))
addtimer(CALLBACK(M, /atom/movable.proc/remove_filter, "pointglow"), 2 SECONDS)
return TRUE
/mob/proc/end_pointing_effect()
if(pointing_effect)
qdel(pointing_effect)
pointing_effect = null
QDEL_NULL(pointing_effect)
/mob/verb/mode()
set name = "Activate Held Object"