module things, jfc
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//this is the main proc. It instantly moves our mobile port to stationary port new_dock
|
||||
/// This is the main proc. It instantly moves our mobile port to stationary port `new_dock`.
|
||||
/obj/docking_port/mobile/proc/initiate_docking(obj/docking_port/stationary/new_dock, movement_direction, force=FALSE)
|
||||
// Crashing this ship with NO SURVIVORS
|
||||
|
||||
@@ -8,8 +8,10 @@
|
||||
|
||||
if(!force)
|
||||
if(!check_dock(new_dock))
|
||||
remove_ripples()
|
||||
return DOCKING_BLOCKED
|
||||
if(!canMove())
|
||||
remove_ripples()
|
||||
return DOCKING_IMMOBILIZED
|
||||
|
||||
var/obj/docking_port/stationary/old_dock = get_docked()
|
||||
@@ -32,12 +34,7 @@
|
||||
|
||||
// The underlying old area is the area assumed to be under the shuttle's starting location
|
||||
// If it no longer/has never existed it will be created
|
||||
var/area/underlying_old_area
|
||||
for(var/i in GLOB.sortedAreas) // Locate grabs subtypes and we want a particular type
|
||||
var/area/place = i
|
||||
if(place.type == underlying_area_type)
|
||||
underlying_old_area = place
|
||||
break
|
||||
var/area/underlying_old_area = GLOB.areas_by_type[underlying_area_type]
|
||||
if(!underlying_old_area)
|
||||
underlying_old_area = new underlying_area_type(null)
|
||||
|
||||
@@ -54,10 +51,9 @@
|
||||
var/list/moved_atoms = list() //Everything not a turf that gets moved in the shuttle
|
||||
var/list/areas_to_move = list() //unique assoc list of areas on turfs being moved
|
||||
|
||||
remove_ripples()
|
||||
|
||||
. = preflight_check(old_turfs, new_turfs, areas_to_move, rotation)
|
||||
if(.)
|
||||
remove_ripples()
|
||||
return
|
||||
|
||||
/*******************************************Hiding turfs if necessary*******************************************/
|
||||
@@ -75,10 +71,15 @@
|
||||
|
||||
if(!force)
|
||||
if(!check_dock(new_dock))
|
||||
remove_ripples()
|
||||
return DOCKING_BLOCKED
|
||||
if(!canMove())
|
||||
remove_ripples()
|
||||
return DOCKING_IMMOBILIZED
|
||||
|
||||
// Moving to the new location will trample the ripples there at the exact
|
||||
// same time any mobs there are trampled, to avoid any discrepancy where
|
||||
// the ripples go away before it is safe.
|
||||
takeoff(old_turfs, new_turfs, moved_atoms, rotation, movement_direction, old_dock, underlying_old_area)
|
||||
|
||||
CHECK_TICK
|
||||
@@ -97,6 +98,8 @@
|
||||
new_dock.last_dock_time = world.time
|
||||
setDir(new_dock.dir)
|
||||
|
||||
// remove any stragglers just in case, and clear the list
|
||||
remove_ripples()
|
||||
return DOCKING_SUCCESS
|
||||
|
||||
/obj/docking_port/mobile/proc/preflight_check(list/old_turfs, list/new_turfs, list/areas_to_move, rotation)
|
||||
|
||||
Reference in New Issue
Block a user