mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-13 11:24:34 +00:00
Fixes error if next_map.json is missing (#34222)
This commit is contained in:
committed by
CitadelStationBot
parent
b2021912d7
commit
d8c3157741
@@ -27,7 +27,7 @@ SUBSYSTEM_DEF(mapping)
|
|||||||
#ifdef FORCE_MAP
|
#ifdef FORCE_MAP
|
||||||
config = new(FORCE_MAP)
|
config = new(FORCE_MAP)
|
||||||
#else
|
#else
|
||||||
config = new
|
config = new(error_if_missing = FALSE)
|
||||||
#endif
|
#endif
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
|
|||||||
@@ -31,15 +31,16 @@
|
|||||||
var/voteweight = 1
|
var/voteweight = 1
|
||||||
var/allow_custom_shuttles = TRUE
|
var/allow_custom_shuttles = TRUE
|
||||||
|
|
||||||
/datum/map_config/New(filename = "data/next_map.json", default_to_box, delete_after)
|
/datum/map_config/New(filename = "data/next_map.json", default_to_box, delete_after, error_if_missing = TRUE)
|
||||||
if(default_to_box)
|
if(default_to_box)
|
||||||
return
|
return
|
||||||
LoadConfig(filename)
|
LoadConfig(filename, error_if_missing)
|
||||||
if(delete_after)
|
if(delete_after)
|
||||||
fdel(filename)
|
fdel(filename)
|
||||||
|
|
||||||
/datum/map_config/proc/LoadConfig(filename)
|
/datum/map_config/proc/LoadConfig(filename, error_if_missing)
|
||||||
if(!fexists(filename))
|
if(!fexists(filename))
|
||||||
|
if(error_if_missing)
|
||||||
log_world("map_config not found: [filename]")
|
log_world("map_config not found: [filename]")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user