From 198656874d9cb79cd5f1761f6ec9ea83f68dd8dd Mon Sep 17 00:00:00 2001 From: Tastyfish Date: Thu, 21 Apr 2016 20:07:00 -0400 Subject: [PATCH] Fixes shuttle smoothing --- code/game/objects/structures/fullwindow.dm | 16 +++++++++++----- code/game/shuttle_engines.dm | 6 ++++++ code/game/turfs/simulated/shuttle.dm | 3 ++- code/modules/shuttle/shuttle.dm | 15 ++++++++++----- 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/code/game/objects/structures/fullwindow.dm b/code/game/objects/structures/fullwindow.dm index fda64fcb740..ac6e57a4135 100644 --- a/code/game/objects/structures/fullwindow.dm +++ b/code/game/objects/structures/fullwindow.dm @@ -89,12 +89,18 @@ health = 160 reinf = 1 - New() - ..() - color = null +/obj/structure/window/full/shuttle/New() + ..() + color = null - update_icon() //icon_state has to be set manually - return +/obj/structure/window/full/shuttle/update_icon() //icon_state has to be set manually + return + +/obj/structure/window/full/shuttle/shuttleRotate(rotation) + ..() + var/matrix/M = transform + M.Turn(rotation) + transform = M /obj/structure/window/full/shuttle/dark icon = 'icons/turf/shuttle.dmi' diff --git a/code/game/shuttle_engines.dm b/code/game/shuttle_engines.dm index f0d0544bd45..820103eb2d4 100644 --- a/code/game/shuttle_engines.dm +++ b/code/game/shuttle_engines.dm @@ -2,6 +2,12 @@ name = "shuttle" icon = 'icons/turf/shuttle.dmi' +/obj/structure/shuttle/shuttleRotate(rotation) + ..() + var/matrix/M = transform + M.Turn(rotation) + transform = M + /obj/structure/shuttle/window name = "shuttle window" icon = 'icons/obj/podwindows.dmi' diff --git a/code/game/turfs/simulated/shuttle.dm b/code/game/turfs/simulated/shuttle.dm index b8d22325d7a..a169d588dd2 100644 --- a/code/game/turfs/simulated/shuttle.dm +++ b/code/game/turfs/simulated/shuttle.dm @@ -36,7 +36,8 @@ T.transform = transform //why don't shuttle walls habe smoothwall? now i gotta do rotation the dirty way -/turf/simulated/shuttle/wall/shuttleRotate(rotation) +/turf/simulated/shuttle/shuttleRotate(rotation) + ..() var/matrix/M = transform M.Turn(rotation) transform = M diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index 2f7c0c06496..2a794de2ff8 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -302,10 +302,6 @@ //rotate our direction dir = angle2dir(rotation+dir2angle(dir)) - //resmooth if need be. - if(smooth) - smooth_icon(src) - //rotate the pixel offsets too. if (pixel_x || pixel_y) if (rotation < 0) @@ -316,6 +312,9 @@ pixel_x = oldPY pixel_y = (oldPX*(-1)) +/atom/proc/postDock() + if(smooth) + smooth_icon(src) //this is the main proc. It instantly moves our mobile port to stationary port S1 @@ -368,7 +367,7 @@ var/list/door_unlock_list = list() - for(var/i=1, i<=L0.len, ++i) + for(var/i in 1 to L0.len) var/turf/T0 = L0[i] if(!T0) continue @@ -443,6 +442,12 @@ T0.CalculateAdjacentTurfs() air_master.add_to_active(T0,1) + for(var/A1 in L1) + var/turf/T1 = A1 + T1.postDock() + for(var/atom/movable/M in T1) + M.postDock() + loc = S1.loc dir = S1.dir