diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 230a77ba1ae..21626590306 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -380,38 +380,3 @@ return new /datum/projectile_data(src_x, src_y, time, distance, power_x, power_y, dest_x, dest_y) -/proc/getRotationFromDirs(dir1, dir2) - return getDegreesFromDir(dir2)-getDegreesFromDir(dir1) - -/proc/getDirFromRotation(rotation, olddir) - return getDirFromDegrees(rotation+getDegreesFromDir(olddir)) - -/proc/getDirFromDegrees(degrees) - if (degrees < 0) - degrees += 360 - if (degrees >= 360) - degrees %= 360 - if (degrees == 360) - degrees = 0 - switch(degrees) - if (0) - return NORTH - if (90) - return EAST - if (180) - return SOUTH - if (270) - return WEST - - -/proc/getDegreesFromDir(dir) - switch(dir) - if (NORTH) - return 0 - if (EAST) - return 90 - if (SOUTH) - return 180 - if (WEST) - return 270 - return 0 \ No newline at end of file diff --git a/code/game/turfs/simulated/walls_misc.dm b/code/game/turfs/simulated/walls_misc.dm index 7b3e20a43ea..e2a05273664 100644 --- a/code/game/turfs/simulated/walls_misc.dm +++ b/code/game/turfs/simulated/walls_misc.dm @@ -62,10 +62,15 @@ T.color = color if(T.dir != dir) T.dir = dir + T.transform = transform return T +/turf/simulated/wall/shuttle/copyTurf(turf/T) + . = ..() + T.transform = transform + //why don't shuttle walls habe smoothwall? now i gotta do rotation the dirty way /turf/simulated/wall/shuttle/shuttleRotate(rotation) - var/matrix/M = matrix(transform) + var/matrix/M = transform M.Turn(rotation) transform = M \ No newline at end of file diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 59b83064827..b76f3056cc0 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -967,4 +967,4 @@ var/list/slot_equipment_priority = list( \ //override to avoid rotating pixel_xy on mobs /mob/shuttleRotate(rotation) - dir = getDirFromRotation(rotation, dir) \ No newline at end of file + dir = angle2dir(rotation+dir2angle(dir)) \ No newline at end of file diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index eeaad37ead2..600795a4f5a 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -270,7 +270,7 @@ //default shuttleRotate /atom/proc/shuttleRotate(rotation) - dir = getDirFromRotation(rotation, dir) + dir = angle2dir(rotation+dir2angle(dir)) //we need to rotate the pixel offsets too. if (pixel_x || pixel_y) @@ -313,6 +313,13 @@ var/list/L0 = return_ordered_turfs(x, y, z, dir, areaInstance) var/list/L1 = return_ordered_turfs(S1.x, S1.y, S1.z, S1.dir) + var/rotation = dir2angle(S1.dir)-dir2angle(dir) + if ((rotation % 90) != 0) + rotation += (rotation % 90) //diagonal rotations not allowed, round up + rotation = SimplifyDegrees(rotation) + + + //remove area surrounding docking port if(areaInstance.contents.len) var/area/A0 = locate("[area_type]") @@ -357,8 +364,8 @@ for(var/atom/movable/AM in T0) - if (dir != S1.dir) - AM.shuttleRotate(getRotationFromDirs(dir,S1.dir)) + if (rotation) + AM.shuttleRotate(rotation) if (istype(AM,/obj)) var/obj/O = AM @@ -392,8 +399,8 @@ M.Weaken(3) T0.ChangeTurf(turf_type) - if (dir != S1.dir) - T1.shuttleRotate(getRotationFromDirs(dir,S1.dir)) + if (rotation) + T1.shuttleRotate(rotation) loc = S1.loc dir = S1.dir