mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 20:47:10 +01:00
ensures map templates don't kill server (#19690)
This commit is contained in:
@@ -51,15 +51,21 @@
|
||||
// if given a multi-z template
|
||||
// it might need to be adapted for that when that time comes
|
||||
GLOB.space_manager.add_dirt(placement.z)
|
||||
var/list/bounds = GLOB.maploader.load_map(get_file(), min_x, min_y, placement.z, shouldCropMap = TRUE)
|
||||
if(!bounds)
|
||||
return 0
|
||||
if(bot_left == null || top_right == null)
|
||||
stack_trace("One of the late setup corners is bust")
|
||||
|
||||
if(ST_bot_left == null || ST_top_right == null)
|
||||
stack_trace("One of the smoothing corners is bust")
|
||||
try
|
||||
var/list/bounds = GLOB.maploader.load_map(get_file(), min_x, min_y, placement.z, shouldCropMap = TRUE)
|
||||
if(!bounds)
|
||||
return 0
|
||||
if(bot_left == null || top_right == null)
|
||||
stack_trace("One of the late setup corners is bust")
|
||||
|
||||
if(ST_bot_left == null || ST_top_right == null)
|
||||
stack_trace("One of the smoothing corners is bust")
|
||||
catch(var/exception/e)
|
||||
GLOB.space_manager.remove_dirt(placement.z)
|
||||
late_setup_level(block(bot_left, top_right), block(ST_bot_left, ST_top_right))
|
||||
message_admins("Map template [name] threw an error while loading. Safe exit attempted, but check for errors at [ADMIN_COORDJMP(placement)].")
|
||||
log_admin("Map template [name] threw an error while loading. Safe exit attempted.")
|
||||
throw e
|
||||
GLOB.space_manager.remove_dirt(placement.z)
|
||||
late_setup_level(
|
||||
block(bot_left, top_right),
|
||||
|
||||
Reference in New Issue
Block a user