From 6baa75a5bf1b3fe105ef2af85bb019af61ff0547 Mon Sep 17 00:00:00 2001
From: chuga-git <98280110+chuga-git@users.noreply.github.com>
Date: Thu, 23 May 2024 00:54:01 -0500
Subject: [PATCH] Removes sleep() call from clockwork and floor turfs (#25541)
* turns sleeps into timer
* revenant death animation converted to animate()
* Update code/game/turfs/simulated/floor/plating.dm
Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com>
Signed-off-by: chuga-git <98280110+chuga-git@users.noreply.github.com>
---------
Signed-off-by: chuga-git <98280110+chuga-git@users.noreply.github.com>
Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com>
---
code/game/gamemodes/miniantags/revenant/revenant.dm | 4 +---
code/game/turfs/simulated/floor/misc_floor.dm | 6 ++++--
code/game/turfs/simulated/floor/plating.dm | 6 ++++--
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/code/game/gamemodes/miniantags/revenant/revenant.dm b/code/game/gamemodes/miniantags/revenant/revenant.dm
index 4ee14c9fdf4..bd35548dfe2 100644
--- a/code/game/gamemodes/miniantags/revenant/revenant.dm
+++ b/code/game/gamemodes/miniantags/revenant/revenant.dm
@@ -223,9 +223,7 @@
playsound(src, 'sound/effects/screech.ogg', 100, 1)
visible_message("[src] lets out a waning screech as violet mist swirls around its dissolving body!")
icon_state = "revenant_draining"
- for(var/i = alpha, i > 0, i -= 10)
- sleep(0.1)
- alpha = i
+ animate(src, alpha = 0, time = 3 SECONDS)
visible_message("[src]'s body breaks apart into a fine pile of blue dust.")
new /obj/item/ectoplasm/revenant(get_turf(src))
ghostize()
diff --git a/code/game/turfs/simulated/floor/misc_floor.dm b/code/game/turfs/simulated/floor/misc_floor.dm
index 01452e74990..ba176cd0c8d 100644
--- a/code/game/turfs/simulated/floor/misc_floor.dm
+++ b/code/game/turfs/simulated/floor/misc_floor.dm
@@ -192,8 +192,10 @@
return
if(!. && isliving(A))
- sleep(2 DECISECONDS)
- new /obj/effect/temp_visual/ratvar/floor(src)
+ addtimer(CALLBACK(src, PROC_REF(spawn_visual)), 0.2 SECONDS, TIMER_DELETE_ME)
+
+/turf/simulated/floor/clockwork/proc/spawn_visual()
+ new /obj/effect/temp_visual/ratvar/floor(src)
/turf/simulated/floor/clockwork/Destroy()
if(uses_overlay && realappearence)
diff --git a/code/game/turfs/simulated/floor/plating.dm b/code/game/turfs/simulated/floor/plating.dm
index 61b11391ba6..050beadb770 100644
--- a/code/game/turfs/simulated/floor/plating.dm
+++ b/code/game/turfs/simulated/floor/plating.dm
@@ -246,8 +246,10 @@
return
if(!. && isliving(A))
- sleep(2 DECISECONDS)
- new /obj/effect/temp_visual/cult/turf/open/floor(src)
+ addtimer(CALLBACK(src, PROC_REF(spawn_visual)), 0.2 SECONDS, TIMER_DELETE_ME)
+
+/turf/simulated/floor/engine/cult/proc/spawn_visual()
+ new /obj/effect/temp_visual/cult/turf/open/floor(src)
/turf/simulated/floor/engine/cult/narsie_act()
return