mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Fix overmap spacemove not actually re-using deepspace sectors.
This commit is contained in:
@@ -29,14 +29,16 @@ var/list/cached_space = list()
|
|||||||
return 1
|
return 1
|
||||||
|
|
||||||
proc/get_deepspace(x,y)
|
proc/get_deepspace(x,y)
|
||||||
var/obj/effect/overmap/visitable/sector/temporary/res = locate(x,y,global.using_map.overmap_z)
|
var/turf/unsimulated/map/overmap_turf = locate(x,y,global.using_map.overmap_z)
|
||||||
|
if(!istype(overmap_turf))
|
||||||
|
CRASH("Attempt to get deepspace at ([x],[y]) which is not on overmap: [overmap_turf]")
|
||||||
|
var/obj/effect/overmap/visitable/sector/temporary/res = locate() in overmap_turf
|
||||||
if(istype(res))
|
if(istype(res))
|
||||||
return res
|
return res
|
||||||
else if(cached_space.len)
|
else if(cached_space.len)
|
||||||
res = cached_space[cached_space.len]
|
res = cached_space[cached_space.len]
|
||||||
cached_space -= res
|
cached_space -= res
|
||||||
res.x = x
|
res.forceMove(overmap_turf)
|
||||||
res.y = y
|
|
||||||
return res
|
return res
|
||||||
else
|
else
|
||||||
return new /obj/effect/overmap/visitable/sector/temporary(x, y, global.using_map.get_empty_zlevel())
|
return new /obj/effect/overmap/visitable/sector/temporary(x, y, global.using_map.get_empty_zlevel())
|
||||||
@@ -110,5 +112,5 @@ proc/overmap_spacetravel(var/turf/space/T, var/atom/movable/A)
|
|||||||
var/obj/effect/overmap/visitable/sector/temporary/source = M
|
var/obj/effect/overmap/visitable/sector/temporary/source = M
|
||||||
if (source.can_die())
|
if (source.can_die())
|
||||||
testing("Caching [M] for future use")
|
testing("Caching [M] for future use")
|
||||||
source.loc = null
|
source.moveToNullspace()
|
||||||
cached_space += source
|
cached_space += source
|
||||||
|
|||||||
Reference in New Issue
Block a user