mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-22 20:57:23 +01:00
Lazily create landable ship's overmap z-level on first use.
- Create the landmark as normal, but instead of allocating a z-level and placing it, register a pre_move listener on the shuttle and setup the z-level only when the shuttle is about to move to its overmap landmark. - Change when shuttles fire the shuttle_pre_move_event to before calculating translation list to give us a chance to allocate the z-level.
This commit is contained in:
@@ -249,16 +249,16 @@
|
||||
log_shuttle("Shuttle [src] aborting attempt_move() because current_location=[current_location] refuses.")
|
||||
return FALSE
|
||||
|
||||
// Observer pattern pre-move
|
||||
var/old_location = current_location
|
||||
GLOB.shuttle_pre_move_event.raise_event(src, old_location, destination)
|
||||
current_location.shuttle_departed(src)
|
||||
|
||||
log_shuttle("[src] moving to [destination]. Areas are [english_list(shuttle_area)]")
|
||||
var/list/translation = list()
|
||||
for(var/area/A in shuttle_area)
|
||||
log_shuttle("Translating [A]")
|
||||
translation += get_turf_translation(get_turf(current_location), get_turf(destination), A.contents)
|
||||
var/old_location = current_location
|
||||
|
||||
// Observer pattern pre-move
|
||||
GLOB.shuttle_pre_move_event.raise_event(src, old_location, destination)
|
||||
current_location.shuttle_departed(src)
|
||||
|
||||
// Actually do it! (This never fails)
|
||||
perform_shuttle_move(destination, translation)
|
||||
|
||||
Reference in New Issue
Block a user