mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-28 15:48:49 +01:00
[MIRROR] byond 1670 support (#12037)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
co-authored by
Kashargul
parent
03abe9a4d4
commit
59ae2027de
@@ -3,7 +3,7 @@
|
||||
version: 1
|
||||
# The BYOND version to use (kept in sync with dependencies.sh by the "TGS Test Suite" CI job)
|
||||
# Must be interpreted as a string, keep quoted
|
||||
byond: "516.1669"
|
||||
byond: "516.1673"
|
||||
# Folders to create in "<instance_path>/Configuration/GameStaticFiles/"
|
||||
static_files:
|
||||
# Config directory should be static
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
|
||||
//Update this whenever you need to take advantage of more recent byond features
|
||||
#define MIN_COMPILER_VERSION 516
|
||||
#define MIN_COMPILER_BUILD 1664
|
||||
#define MIN_COMPILER_BUILD 1667
|
||||
#if (DM_VERSION < MIN_COMPILER_VERSION || DM_BUILD < MIN_COMPILER_BUILD) && !defined(SPACEMAN_DMM) && !defined(OPENDREAM)
|
||||
//Don't forget to update this part
|
||||
#error Your version of BYOND is too out-of-date to compile this project. Go to https://secure.byond.com/download and update.
|
||||
#error You need version 516.1664 or higher
|
||||
#error You need version 516.1667 or higher
|
||||
#endif
|
||||
|
||||
// Keep savefile compatibilty at minimum supported level
|
||||
|
||||
@@ -48,6 +48,18 @@
|
||||
/// Create a typed list global that is initialized as an empty list
|
||||
#define GLOBAL_LIST_EMPTY_TYPED(X, Typepath) GLOBAL_LIST_INIT_TYPED(X, Typepath, list())
|
||||
|
||||
/// Create an alist global with an initializer expression
|
||||
#define GLOBAL_ALIST_INIT(X, InitValue) GLOBAL_RAW(/alist/##X); GLOBAL_MANAGED(X, InitValue)
|
||||
|
||||
/// Create an alist global that is initialized as an empty list
|
||||
#define GLOBAL_ALIST_EMPTY(X) GLOBAL_ALIST_INIT(X, alist())
|
||||
|
||||
/// Create a typed alist global with an initializer expression
|
||||
//#define GLOBAL_ALIST_INIT_TYPED(X, Typepath, InitValue) GLOBAL_RAW(/alist##Typepath/X); GLOBAL_MANAGED(X, InitValue) // Missing in spacemandmm
|
||||
|
||||
/// Create a typed alist global that is initialized as an empty list
|
||||
//#define GLOBAL_ALIST_EMPTY_TYPED(X, Typepath) GLOBAL_ALIST_INIT_TYPED(X, Typepath, alist()) // Missing in spacemandmm
|
||||
|
||||
/// Create a typed global with an initializer expression
|
||||
#define GLOBAL_DATUM_INIT(X, Typepath, InitValue) GLOBAL_RAW(Typepath/##X); GLOBAL_MANAGED(X, InitValue)
|
||||
|
||||
@@ -57,5 +69,8 @@
|
||||
/// Create a null global list
|
||||
#define GLOBAL_LIST(X) GLOBAL_RAW(/list/##X); GLOBAL_UNMANAGED(X)
|
||||
|
||||
/// Create a null global alist
|
||||
#define GLOBAL_ALIST(X) GLOBAL_RAW(/alist/##X); GLOBAL_UNMANAGED(X)
|
||||
|
||||
/// Create a typed null global
|
||||
#define GLOBAL_DATUM(X, Typepath) GLOBAL_RAW(Typepath/##X); GLOBAL_UNMANAGED(X)
|
||||
|
||||
@@ -1043,6 +1043,29 @@ GLOBAL_LIST_EMPTY(json_cache)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/**
|
||||
* Attempts to convert a numeric keyed alist of (2=second, 1=first) to a list of (first, second).
|
||||
*
|
||||
* If you instead want to discard values and keep only keys, just do list + alist.
|
||||
*
|
||||
* Arguments:
|
||||
* * to_flatten - The alist with sequential numeric keys to extract values from into a normal list.
|
||||
* * assert - Whether to assert every key is numeric and in bounds.
|
||||
*/
|
||||
/proc/flatten_numeric_alist(alist/to_flatten, assert=TRUE)
|
||||
RETURN_TYPE(/list)
|
||||
|
||||
var/count = length(to_flatten)
|
||||
if(assert)
|
||||
for(var/key in to_flatten)
|
||||
if(!isnum(key) || key < 1 || key > count)
|
||||
CRASH("flatten_numeric_alist not possible for alist: [json_encode(to_flatten)]")
|
||||
|
||||
var/list/retval = list()
|
||||
for(var/i in 1 to count)
|
||||
retval += to_flatten[i]
|
||||
return retval
|
||||
|
||||
//CHOMPAdd start
|
||||
/proc/pick_weight(list/list_to_pick)
|
||||
var/total = 0
|
||||
|
||||
@@ -1243,7 +1243,7 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle = new
|
||||
|
||||
GLOBAL_LIST_EMPTY(gun_choices)
|
||||
|
||||
GLOBAL_LIST_INIT(severity_to_string, list(
|
||||
GLOBAL_ALIST_INIT(severity_to_string, alist(
|
||||
EVENT_LEVEL_MUNDANE = "Mundane",
|
||||
EVENT_LEVEL_MODERATE = "Moderate",
|
||||
EVENT_LEVEL_MAJOR = "Major"
|
||||
|
||||
@@ -11,13 +11,13 @@ SUBSYSTEM_DEF(events)
|
||||
var/list/datum/event/finished_events = list()
|
||||
|
||||
var/list/datum/event/allEvents
|
||||
var/list/datum/event_container/event_containers
|
||||
var/alist/event_containers
|
||||
|
||||
var/datum/event_meta/new_event = new
|
||||
|
||||
/datum/controller/subsystem/events/Initialize()
|
||||
allEvents = subtypesof(/datum/event)
|
||||
event_containers = list(
|
||||
event_containers = alist(
|
||||
EVENT_LEVEL_MUNDANE = new/datum/event_container/mundane,
|
||||
EVENT_LEVEL_MODERATE = new/datum/event_container/moderate,
|
||||
EVENT_LEVEL_MAJOR = new/datum/event_container/major
|
||||
|
||||
@@ -379,7 +379,7 @@ SUBSYSTEM_DEF(timer)
|
||||
var/spent = 0
|
||||
/// Holds info about this timer, stored from the moment it was created
|
||||
/// Used to create a visible "name" whenever the timer is stringified
|
||||
var/list/timer_info
|
||||
var/alist/timer_info
|
||||
/// Next timed event in the bucket
|
||||
var/datum/timedevent/next
|
||||
/// Previous timed event in the bucket
|
||||
@@ -521,7 +521,7 @@ SUBSYSTEM_DEF(timer)
|
||||
/datum/timedevent/proc/bucketJoin()
|
||||
#if defined(TIMER_DEBUG)
|
||||
// Generate debug-friendly list for timer, more complex but also more expensive
|
||||
timer_info = list(
|
||||
timer_info = alist(
|
||||
1 = id,
|
||||
2 = timeToRun,
|
||||
3 = wait,
|
||||
@@ -536,7 +536,7 @@ SUBSYSTEM_DEF(timer)
|
||||
)
|
||||
#else
|
||||
// Generate a debuggable list for the timer, simpler but wayyyy cheaper, string generation (and ref/copy memes) is a bitch and this saves a LOT of time
|
||||
timer_info = list(
|
||||
timer_info = alist(
|
||||
1 = id,
|
||||
2 = timeToRun,
|
||||
3 = wait,
|
||||
|
||||
@@ -7,38 +7,38 @@
|
||||
|
||||
feedback_add_details("admin_verb","CP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
if(tgui_alert(usr, "WARNING: This command should not be run on a live server. Do you want to continue?", "Check Piping", list("No", "Yes")) != "Yes")
|
||||
if(tgui_alert(src, "WARNING: This command should not be run on a live server. Do you want to continue?", "Check Piping", list("No", "Yes")) != "Yes")
|
||||
return
|
||||
|
||||
to_chat(usr, "Checking for disconnected pipes...")
|
||||
to_chat(src, "Checking for disconnected pipes...")
|
||||
//all plumbing - yes, some things might get stated twice, doesn't matter.
|
||||
for (var/obj/machinery/atmospherics/plumbing in GLOB.machines)
|
||||
if (plumbing.nodealert)
|
||||
to_chat(usr, span_filter_adminlog(span_warning("Unconnected [plumbing.name] located at [plumbing.x],[plumbing.y],[plumbing.z] ([get_area(plumbing.loc)])")))
|
||||
to_chat(src, span_filter_adminlog(span_warning("Unconnected [plumbing.name] located at [plumbing.x],[plumbing.y],[plumbing.z] ([get_area(plumbing.loc)])")))
|
||||
|
||||
//Manifolds
|
||||
for (var/obj/machinery/atmospherics/pipe/manifold/pipe in GLOB.machines)
|
||||
if (!pipe.node1 || !pipe.node2 || !pipe.node3)
|
||||
to_chat(usr, span_filter_adminlog(span_warning("Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])")))
|
||||
to_chat(src, span_filter_adminlog(span_warning("Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])")))
|
||||
|
||||
//Pipes
|
||||
for (var/obj/machinery/atmospherics/pipe/simple/pipe in GLOB.machines)
|
||||
if (!pipe.node1 || !pipe.node2)
|
||||
to_chat(usr, span_filter_adminlog(span_warning("Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])")))
|
||||
to_chat(src, span_filter_adminlog(span_warning("Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])")))
|
||||
|
||||
to_chat(usr, "Checking for overlapping pipes...")
|
||||
to_chat(src, "Checking for overlapping pipes...")
|
||||
next_turf:
|
||||
for(var/turf/T in world)
|
||||
for(var/dir in GLOB.cardinal)
|
||||
var/list/connect_types = list(1 = 0, 2 = 0, 3 = 0)
|
||||
var/alist/connect_types = alist(1 = 0, 2 = 0, 3 = 0)
|
||||
for(var/obj/machinery/atmospherics/pipe in T)
|
||||
if(dir & pipe.initialize_directions)
|
||||
for(var/connect_type in pipe.connect_types)
|
||||
connect_types[connect_type] += 1
|
||||
if(connect_types[1] > 1 || connect_types[2] > 1 || connect_types[3] > 1)
|
||||
to_chat(usr, span_filter_adminlog(span_warning("Overlapping pipe ([pipe.name]) located at [T.x],[T.y],[T.z] ([get_area(T)])")))
|
||||
to_chat(src, span_filter_adminlog(span_warning("Overlapping pipe ([pipe.name]) located at [T.x],[T.y],[T.z] ([get_area(T)])")))
|
||||
continue next_turf
|
||||
to_chat(usr, "Done")
|
||||
to_chat(src, "Done")
|
||||
|
||||
/client/proc/powerdebug()
|
||||
set category = "Mapping"
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
# byond version
|
||||
export BYOND_MAJOR=516
|
||||
export BYOND_MINOR=1669
|
||||
export BYOND_MINOR=1673
|
||||
|
||||
# Macro Count
|
||||
export MACRO_COUNT=6
|
||||
|
||||
Reference in New Issue
Block a user