mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 03:27:05 +01:00
move shuttle loading to cordons (#31237)
* move shuttle loading to cordons * clean up our reservations after we move * pull logs up to stack traces
This commit is contained in:
@@ -11,10 +11,6 @@
|
||||
abstract_move(T1)
|
||||
return 1
|
||||
|
||||
/obj/effect/landmark/shuttle_import/onShuttleMove()
|
||||
// Used for marking where to preview/load shuttles
|
||||
return 0
|
||||
|
||||
/obj/docking_port/onShuttleMove()
|
||||
// Stationary ports shouldn't move, mobile ones move themselves
|
||||
return 0
|
||||
|
||||
@@ -582,6 +582,7 @@
|
||||
W.update_eligible_areas()
|
||||
W.update_audio()
|
||||
mobile_port.unlockPortDoors(S1)
|
||||
SEND_SIGNAL(mobile_port, COMSIG_MOBILE_PORT_DOCKED, S1)
|
||||
|
||||
/obj/docking_port/mobile/proc/is_turf_blacklisted_for_transit(turf/T)
|
||||
var/static/list/blacklisted_turf_types = typecacheof(list(/turf/space, /turf/simulated/floor/chasm, /turf/simulated/floor/lava, /turf/simulated/floor/plating/asteroid))
|
||||
@@ -616,11 +617,6 @@
|
||||
else
|
||||
. = null
|
||||
|
||||
/obj/effect/landmark/shuttle_import
|
||||
name = "Shuttle Import"
|
||||
|
||||
|
||||
|
||||
//shuttle-door closing is handled in the dock() proc whilst looping through turfs
|
||||
//this one closes the door where we are docked at, if there is one there.
|
||||
/obj/docking_port/mobile/proc/closePortDoors(obj/docking_port/stationary/S0)
|
||||
|
||||
@@ -160,3 +160,44 @@
|
||||
/datum/turf_reservation/transit
|
||||
turf_type = /turf/space/transit
|
||||
required_traits = list(TCOMM_RELAY_ALWAYS)
|
||||
|
||||
/datum/turf_reservation/shuttle
|
||||
|
||||
/datum/turf_reservation/shuttle/proc/locate_docking_port()
|
||||
// Search the turfs for docking ports
|
||||
// - We need to find the mobile docking port because that is the heart of
|
||||
// the shuttle.
|
||||
// - We need to check that no additional ports have slipped in from the
|
||||
// template, because that causes unintended behaviour.
|
||||
var/mobile_docking_ports = 0
|
||||
var/obj/docking_port/mobile/port
|
||||
for(var/T as anything in reserved_turfs)
|
||||
for(var/obj/docking_port/P in T)
|
||||
if(istype(P, /obj/docking_port/mobile))
|
||||
port = P
|
||||
mobile_docking_ports++
|
||||
if(mobile_docking_ports > 1)
|
||||
qdel(P, force = TRUE)
|
||||
stack_trace("shuttle template has multiple mobile docking ports")
|
||||
else if(!port.timid)
|
||||
// The shuttle template we loaded isn't "timid" which means
|
||||
// it's already registered with the shuttles subsystem.
|
||||
// This is a bad thing.
|
||||
stack_trace("shuttle template is non-timid! Unloading.")
|
||||
port.jumpToNullSpace()
|
||||
return
|
||||
|
||||
if(istype(P, /obj/docking_port/stationary))
|
||||
stack_trace("shuttle template has a stationary docking port")
|
||||
|
||||
if(!port)
|
||||
stack_trace("could not find shuttle template mobile docking port")
|
||||
return
|
||||
|
||||
RegisterSignal(port, COMSIG_MOBILE_PORT_DOCKED, PROC_REF(cleanup))
|
||||
return port
|
||||
|
||||
/datum/turf_reservation/shuttle/proc/cleanup(datum/source, obj/docking_port/stationary/dest)
|
||||
SIGNAL_HANDLER // COMSIG_MOBILE_PORT_DOCKED
|
||||
UnregisterSignal(source, COMSIG_MOBILE_PORT_DOCKED)
|
||||
qdel(src)
|
||||
|
||||
Reference in New Issue
Block a user