Next round of shuttle fixes at the cost of a small piece of my sanity (#31784)

* shuttle bugs begone

* cleanup
This commit is contained in:
Emmett Gaines
2017-10-17 13:00:10 -04:00
committed by CitadelStationBot
parent 9691c9130f
commit 8a336215f1
4 changed files with 29 additions and 10 deletions
+12 -3
View File
@@ -566,8 +566,10 @@
index++
var/turf/oldT = place
var/turf/newT = new_turfs[index]
if(!newT || !oldT)
continue
if(!newT)
return DOCKING_NULL_DESTINATION
if(!oldT)
return DOCKING_NULL_SOURCE
var/area/old_area = oldT.loc
var/move_mode = old_area.beforeShuttleMove(shuttle_areas) //areas
@@ -673,7 +675,14 @@
// then try again
switch(mode)
if(SHUTTLE_CALL)
if(dock(destination, preferred_direction) != DOCKING_SUCCESS)
var/error = dock(destination, preferred_direction)
if(error && error & (DOCKING_NULL_DESTINATION | DOCKING_NULL_SOURCE))
var/msg = "A mobile dock in transit exited dock() with an error. This is most likely a mapping problem: Error: [error], ([src]) ([previous])"
WARNING(msg)
message_admins(msg)
mode = SHUTTLE_IDLE
return
else if(error)
setTimer(20)
return
if(SHUTTLE_RECALL)