From c4e008e15bf7c9d49931364b5b7d56e15d69ddda Mon Sep 17 00:00:00 2001 From: Interception&? <137328283+intercepti0n@users.noreply.github.com> Date: Tue, 23 Apr 2024 19:41:42 +0300 Subject: [PATCH] fix(skybox): skybox no longer offsets beyond screen size --- code/_onclick/hud/skybox.dm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/code/_onclick/hud/skybox.dm b/code/_onclick/hud/skybox.dm index d20754f6835..1eff77a3a2c 100644 --- a/code/_onclick/hud/skybox.dm +++ b/code/_onclick/hud/skybox.dm @@ -39,8 +39,18 @@ var/atom/position = owner.client.eye var/normalized_x = (position.x - TRANSITION_EDGE) / (world.maxx - (TRANSITION_EDGE * 2)) var/normalized_y = (position.y - TRANSITION_EDGE) / (world.maxy - (TRANSITION_EDGE * 2)) + var/result_x = round(view_maxx * WORLD_ICON_SIZE * normalized_x) var/result_y = round(view_maxy * WORLD_ICON_SIZE * normalized_y) + + var/max_offset = abs(view_sizes[1] - view_sizes[2]) * WORLD_ICON_SIZE + + if(view_maxx > view_maxy) + result_x = min(max_offset, result_x) + + if(view_maxy > view_maxx) + result_y = min(max_offset, result_y) + screen_loc = "BOTTOM:[-result_y],LEFT:[-result_x]" /obj/skybox/proc/DoRotate()