From 4b04f9012d1763df625e9e4ae75e4cf4bd1f3771 Mon Sep 17 00:00:00 2001 From: Kyle Spier-Swenson Date: Tue, 22 Jun 2021 14:57:39 -0700 Subject: [PATCH] Removes animate that almost never did anything from parallax (#59759) This animate wouldn't run if the jump was too big, meaning we were only ever animating 1 or 2 pixels of parallax, and i do not believe the cost on the server nor the client is warranted for how unnoticeable this animation is. --- code/_onclick/hud/parallax.dm | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/code/_onclick/hud/parallax.dm b/code/_onclick/hud/parallax.dm index 5a499e1108c..0fdb537d37d 100755 --- a/code/_onclick/hud/parallax.dm +++ b/code/_onclick/hud/parallax.dm @@ -195,18 +195,13 @@ if (L.view_sized != C.view) L.update_o(C.view) - var/change_x - var/change_y - if(L.absolute) L.offset_x = -(posobj.x - SSparallax.planet_x_offset) * L.speed L.offset_y = -(posobj.y - SSparallax.planet_y_offset) * L.speed else - change_x = offset_x * L.speed - L.offset_x -= change_x - change_y = offset_y * L.speed - L.offset_y -= change_y - + L.offset_x -= offset_x * L.speed + L.offset_y -= offset_y * L.speed + if(L.offset_x > 240) L.offset_x -= 480 if(L.offset_x < -240) @@ -216,11 +211,6 @@ if(L.offset_y < -240) L.offset_y += 480 - - if(!areaobj.parallax_movedir && C.dont_animate_parallax <= world.time && (offset_x || offset_y) && abs(offset_x) <= max(C.parallax_throttle/world.tick_lag+1,1) && abs(offset_y) <= max(C.parallax_throttle/world.tick_lag+1,1) && (round(abs(change_x)) > 1 || round(abs(change_y)) > 1)) - L.transform = matrix(1, 0, offset_x*L.speed, 0, 1, offset_y*L.speed) - animate(L, transform=matrix(), time = last_delay) - L.screen_loc = "CENTER-7:[round(L.offset_x,1)],CENTER-7:[round(L.offset_y,1)]" /atom/movable/proc/update_parallax_contents()