mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +00:00
Merge pull request #11692 from VOREStation/vplk-fix-infinate-spacelost
Fix getting stuck in deep space because of bad creation of temporary sectors
This commit is contained in:
committed by
Chompstation Bot
parent
071fe8df93
commit
4d2c0e9685
@@ -5,15 +5,16 @@
|
|||||||
known = FALSE
|
known = FALSE
|
||||||
in_space = TRUE
|
in_space = TRUE
|
||||||
|
|
||||||
/obj/effect/overmap/visitable/sector/temporary/Initialize(var/nx, var/ny)
|
/obj/effect/overmap/visitable/sector/temporary/Initialize()
|
||||||
|
if(!istype(loc, /turf/unsimulated/map))
|
||||||
|
CRASH("Attempt to create deepspace which is not on overmap: [log_info_line(loc)]")
|
||||||
|
// Tell sector initializer where are is where we want to be.
|
||||||
|
start_x = loc.x
|
||||||
|
start_y = loc.y
|
||||||
|
// But pick an empty z level to use
|
||||||
|
map_z += global.using_map.get_empty_zlevel()
|
||||||
. = ..()
|
. = ..()
|
||||||
loc = locate(nx, ny, global.using_map.overmap_z)
|
testing("Temporary sector at [x],[y],[z] was created, corresponding zlevel is [english_list(map_z)].")
|
||||||
x = nx
|
|
||||||
y = ny
|
|
||||||
var/emptyz = global.using_map.get_empty_zlevel()
|
|
||||||
map_z += emptyz
|
|
||||||
map_sectors["[emptyz]"] = src
|
|
||||||
testing("Temporary sector at [x],[y] was created, corresponding zlevel is [emptyz].")
|
|
||||||
|
|
||||||
/obj/effect/overmap/visitable/sector/temporary/Destroy()
|
/obj/effect/overmap/visitable/sector/temporary/Destroy()
|
||||||
for(var/zlevel in map_z)
|
for(var/zlevel in map_z)
|
||||||
@@ -43,7 +44,7 @@
|
|||||||
var/obj/effect/overmap/visitable/sector/temporary/res = locate() in overmap_turf
|
var/obj/effect/overmap/visitable/sector/temporary/res = locate() in overmap_turf
|
||||||
if(istype(res))
|
if(istype(res))
|
||||||
return res
|
return res
|
||||||
return new /obj/effect/overmap/visitable/sector/temporary(x, y)
|
return new /obj/effect/overmap/visitable/sector/temporary(overmap_turf)
|
||||||
|
|
||||||
/atom/movable/proc/lost_in_space()
|
/atom/movable/proc/lost_in_space()
|
||||||
for(var/atom/movable/AM in contents)
|
for(var/atom/movable/AM in contents)
|
||||||
@@ -133,6 +134,8 @@
|
|||||||
TM = get_deepspace(M.x,M.y)
|
TM = get_deepspace(M.x,M.y)
|
||||||
nz = pick(TM.get_space_zlevels())
|
nz = pick(TM.get_space_zlevels())
|
||||||
|
|
||||||
|
testing("spacetravel chose [nz],[ny],[nz] in sector [TM] @ ([TM.x],[TM.y],[TM.z])")
|
||||||
|
|
||||||
var/turf/dest = locate(nx,ny,nz)
|
var/turf/dest = locate(nx,ny,nz)
|
||||||
if(istype(dest))
|
if(istype(dest))
|
||||||
A.forceMove(dest)
|
A.forceMove(dest)
|
||||||
|
|||||||
Reference in New Issue
Block a user