[s] Prevent unbreakable ladders from being moved by shuttles (#38477)
* Prevent unbreakable ladders from being moved by shuttles * Disconnect ladders before and reconnect them after shuttle move
This commit is contained in:
@@ -23,13 +23,7 @@
|
||||
/obj/structure/ladder/Destroy(force)
|
||||
if ((resistance_flags & INDESTRUCTIBLE) && !force)
|
||||
return QDEL_HINT_LETMELIVE
|
||||
|
||||
if(up && up.down == src)
|
||||
up.down = null
|
||||
up.update_icon()
|
||||
if(down && down.up == src)
|
||||
down.up = null
|
||||
down.update_icon()
|
||||
disconnect()
|
||||
return ..()
|
||||
|
||||
/obj/structure/ladder/LateInitialize()
|
||||
@@ -52,6 +46,15 @@
|
||||
|
||||
update_icon()
|
||||
|
||||
/obj/structure/ladder/proc/disconnect()
|
||||
if(up && up.down == src)
|
||||
up.down = null
|
||||
up.update_icon()
|
||||
if(down && down.up == src)
|
||||
down.up = null
|
||||
down.update_icon()
|
||||
up = down = null
|
||||
|
||||
/obj/structure/ladder/update_icon()
|
||||
if(up && down)
|
||||
icon_state = "ladder11"
|
||||
|
||||
@@ -331,6 +331,21 @@ All ShuttleMove procs go here
|
||||
if(. & MOVE_AREA)
|
||||
. |= MOVE_CONTENTS
|
||||
|
||||
/obj/structure/ladder/beforeShuttleMove(turf/newT, rotation, move_mode, obj/docking_port/mobile/moving_dock)
|
||||
. = ..()
|
||||
if (!(resistance_flags & INDESTRUCTIBLE))
|
||||
disconnect()
|
||||
|
||||
/obj/structure/ladder/afterShuttleMove(turf/oldT, list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
|
||||
. = ..()
|
||||
if (!(resistance_flags & INDESTRUCTIBLE))
|
||||
LateInitialize()
|
||||
|
||||
/obj/structure/ladder/onShuttleMove(turf/newT, turf/oldT, list/movement_force, move_dir, obj/docking_port/stationary/old_dock, obj/docking_port/mobile/moving_dock)
|
||||
if (resistance_flags & INDESTRUCTIBLE)
|
||||
// simply don't be moved
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/************************************Misc move procs************************************/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user