Skip to content

Commit

Permalink
Merge branch 'master' into project/ares/receptiondesk
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Apr 15, 2024
2 parents b512c76 + 1d85465 commit 64d1351
Show file tree
Hide file tree
Showing 132 changed files with 3,341 additions and 1,879 deletions.
2 changes: 0 additions & 2 deletions .github/alternate_byond_versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@
# Format is version: map
# Example:
# 500.1337: runtimestation

515.1630: lv624
2 changes: 1 addition & 1 deletion .tgs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: 1
byond: "514.1588"
byond: "515.1627"
static_files:
- name: config
- name: data
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/__spacemandmm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@
/world/Del()
var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL")
if (debug_server)
LIBCALL(debug_server, "auxtools_shutdown")()
call_ext(debug_server, "auxtools_shutdown")()
. = ..()
9 changes: 0 additions & 9 deletions code/__DEFINES/_macros.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,8 @@

#define subtypesof(A) (typesof(A) - A)

#ifdef EXPERIMENT_515_DONT_CACHE_REF
/// Takes a datum as input, returns its ref string
#define text_ref(datum) ref(datum)
#else
/// Takes a datum as input, returns its ref string, or a cached version of it
/// This allows us to cache \ref creation, which ensures it'll only ever happen once per datum, saving string tree time
/// It is slightly less optimal then a []'d datum, but the cost is massively outweighed by the potential savings
/// It will only work for datums mind, for datum reasons
/// : because of the embedded typecheck
#define text_ref(datum) (isdatum(datum) ? (datum:cached_ref ||= "\ref[datum]") : ("\ref[datum]"))
#endif

#define addToListNoDupe(L, index) if(L) L[index] = null; else L = list(index)

Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/signals_global.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,6 @@

#define COMSIG_GLOB_HIJACK_IMPACTED "!hijack_impacted"
#define COMSIG_GLOB_HIJACK_LANDED "!hijack_landed"

/// From /datum/controller/subsystem/hijack/fire()
#define COMSIG_GLOB_FUEL_PUMP_UPDATE "!fuel_pump_update"
2 changes: 2 additions & 0 deletions code/__DEFINES/equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
#define ANIMATED_SURGICAL_TOOL (1<<12)
/// Has heat source but isn't 'on fire' and thus can be stored
#define IGNITING_ITEM (1<<13)
/// Overrides NODROP in some cases (stripping)
#define FORCEDROP_CONDITIONAL (1<<14)
//==========================================================================================


Expand Down
9 changes: 9 additions & 0 deletions code/__DEFINES/mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@
#define PAIN_OVERLAY_LEGACY 2 //Creates a legacy blurring effect over your screen if you have any eye_blur at all. Not recommended.
//=================================================

//=================================================
#define FLASH_OVERLAY_WHITE 0 //Flashes your screen white.
#define FLASH_OVERLAY_DARK 1 //Flashes your screen a dark grey.
//=================================================

//=================================================
#define CRIT_OVERLAY_WHITE 0 //Overlays your screen white.
#define CRIT_OVERLAY_DARK 1 //Overlays your screen a dark grey.
//=================================================

/// Number of weighted marine players for 1 gear_scale. gear_scale is clamped to 1 minimum
#define MARINE_GEAR_SCALING_NORMAL 50
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ GLOBAL_LIST_INIT(RESTRICTED_CAMERA_NETWORKS, list( //Those networks can only be
#define RESULT_REQUIRES_SNOW (1<<0)


/// Reaction type from touching it
#define TOUCH 1
/// Reaction type from eating it
#define INGEST 2

/// Marks an object as organic. Used for alien structures and any other organic material
Expand Down
30 changes: 30 additions & 0 deletions code/__DEFINES/strippable.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// All of these must be matched in StripMenu.js.
#define STRIPPABLE_ITEM_HEAD "head"
#define STRIPPABLE_ITEM_BACK "back"
#define STRIPPABLE_ITEM_MASK "wear_mask"
#define STRIPPABLE_ITEM_EYES "glasses"
#define STRIPPABLE_ITEM_L_EAR "wear_l_ear"
#define STRIPPABLE_ITEM_R_EAR "wear_r_ear"
#define STRIPPABLE_ITEM_JUMPSUIT "w_uniform"
#define STRIPPABLE_ITEM_SUIT "wear_suit"
#define STRIPPABLE_ITEM_GLOVES "gloves"
#define STRIPPABLE_ITEM_FEET "shoes"
#define STRIPPABLE_ITEM_SUIT_STORAGE "j_store"
#define STRIPPABLE_ITEM_ID "id"
#define STRIPPABLE_ITEM_BELT "belt"
#define STRIPPABLE_ITEM_LPOCKET "l_store"
#define STRIPPABLE_ITEM_RPOCKET "r_store"
#define STRIPPABLE_ITEM_LHAND "l_hand"
#define STRIPPABLE_ITEM_RHAND "r_hand"
#define STRIPPABLE_ITEM_HANDCUFFS "handcuffs"
#define STRIPPABLE_ITEM_LEGCUFFS "legcuffs"


/// This slot is not obscured.
#define STRIPPABLE_OBSCURING_NONE 0

/// This slot is completely obscured, and cannot be accessed.
#define STRIPPABLE_OBSCURING_COMPLETELY 1

/// This slot can't be seen, but can be accessed.
#define STRIPPABLE_OBSCURING_HIDDEN 2
1 change: 1 addition & 0 deletions code/__HELPERS/_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,4 @@

for(var/i in 1 to inserted_list.len - 1)
inserted_list.Swap(i, rand(i, inserted_list.len))

4 changes: 0 additions & 4 deletions code/__HELPERS/nameof.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,4 @@
/**
* NAMEOF that actually works in static definitions because src::type requires src to be defined
*/
#if DM_VERSION >= 515
#define NAMEOF_STATIC(datum, X) (nameof(type::##X))
#else
#define NAMEOF_STATIC(datum, X) (#X || ##datum.##X)
#endif
59 changes: 4 additions & 55 deletions code/_byond_version_compat.dm
Original file line number Diff line number Diff line change
@@ -1,56 +1,17 @@
// This file contains defines allowing targeting byond versions newer than the supported

//Update this whenever you need to take advantage of more recent byond features
#define MIN_COMPILER_VERSION 514
#define MIN_COMPILER_BUILD 1588
#define MIN_COMPILER_VERSION 515
#define MIN_COMPILER_BUILD 1627
#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 514.1588 or higher
#endif

/*
#if (DM_VERSION == 514 && DM_BUILD > 1575 && DM_BUILD <= 1577)
#error Your version of BYOND currently has a crashing issue that will prevent you from running Dream Daemon test servers.
#error We require developers to test their content, so an inability to test means we cannot allow the compile.
#error Please consider downgrading to 514.1575 or lower.
#endif
*/

/*
// Keep savefile compatibilty at minimum supported level
#if DM_VERSION >= 515
/savefile/byond_version = MIN_COMPILER_VERSION
#endif
*/

// 515 split call for external libraries into call_ext
#if DM_VERSION < 515
#define LIBCALL call
#else
#define LIBCALL call_ext
#error Your version of BYOND is too out-of-date to compile this project. Go to https://www.byond.com/download and update.
#error You need version 515.1627 or higher
#endif

// So we want to have compile time guarantees these methods exist on local type, unfortunately 515 killed the .proc/procname and .verb/verbname syntax so we have to use nameof()
// For the record: GLOBAL_VERB_REF would be useless as verbs can't be global.

#if DM_VERSION < 515

/// Call by name proc references, checks if the proc exists on either this type or as a global proc.
#define PROC_REF(X) (.proc/##X)
/// Call by name verb references, checks if the verb exists on either this type or as a global verb.
#define VERB_REF(X) (.verb/##X)

/// Call by name proc reference, checks if the proc exists on either the given type or as a global proc
#define TYPE_PROC_REF(TYPE, X) (##TYPE.proc/##X)
/// Call by name verb reference, checks if the verb exists on either the given type or as a global verb
#define TYPE_VERB_REF(TYPE, X) (##TYPE.verb/##X)

/// Call by name proc reference, checks if the proc is an existing global proc
#define GLOBAL_PROC_REF(X) (/proc/##X)

#else

/// Call by name proc references, checks if the proc exists on either this type or as a global proc.
#define PROC_REF(X) (nameof(.proc/##X))
/// Call by name verb references, checks if the verb exists on either this type or as a global verb.
Expand All @@ -64,16 +25,4 @@
/// Call by name proc reference, checks if the proc is an existing global proc
#define GLOBAL_PROC_REF(X) (/proc/##X)

#endif

#if (DM_VERSION == 515)
/// fcopy will crash on 515 linux if given a non-existant file, instead of returning 0 like on 514 linux or 515 windows
/// var case matches documentation for fcopy.
/world/proc/__fcopy(Src, Dst)
if (istext(Src) && !fexists(Src))
return 0
return fcopy(Src, Dst)

#define fcopy(Src, Dst) world.__fcopy(Src, Dst)

#endif
24 changes: 1 addition & 23 deletions code/_experiments.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,7 @@
// Any flag you see here can be flipped with the `-D` CLI argument.
// For example, if you want to enable EXPERIMENT_MY_COOL_FEATURE, compile with -DEXPERIMENT_MY_COOL_FEATURE

// EXPERIMENT_515_QDEL_HARD_REFERENCE
// - Hold a hard reference for qdeleted items, and check ref_count, rather than using refs. Requires 515+.

// EXPERIMENT_515_DONT_CACHE_REF
// - Avoids `text_ref` caching, aided by improvements to ref() speed in 515.

#if DM_VERSION < 515

// You can't X-macro custom names :(
#ifdef EXPERIMENT_515_QDEL_HARD_REFERENCE
#warn EXPERIMENT_515_QDEL_HARD_REFERENCE is only available on 515+
#undef EXPERIMENT_515_QDEL_HARD_REFERENCE
#endif

#ifdef EXPERIMENT_515_DONT_CACHE_REF
#warn EXPERIMENT_515_DONT_CACHE_REF is only available on 515+
#undef EXPERIMENT_515_DONT_CACHE_REF
#endif

#elif defined(UNIT_TESTS)

//#define EXPERIMENT_515_QDEL_HARD_REFERENCE
#define EXPERIMENT_515_DONT_CACHE_REF
#if defined(UNIT_TESTS)

#endif

Expand Down
5 changes: 5 additions & 0 deletions code/_macros.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@
#define LAZYREMOVEASSOC(L, K, V) if(L) { if(L[K]) { L[K] -= V; if(!length(L[K])) L -= K; } if(!length(L)) L = null; }
///Accesses an associative list, returns null if nothing is found
#define LAZYACCESSASSOC(L, I, K) L ? L[I] ? L[I][K] ? L[I][K] : null : null : null
///Performs an insertion on the given lazy list with the given key and value. If the value already exists, a new one will not be made.
#define LAZYORASSOCLIST(lazy_list, key, value) \
LAZYINITLIST(lazy_list); \
LAZYINITLIST(lazy_list[key]); \
lazy_list[key] |= value;

// Insert an object A into a sorted list using cmp_proc (/code/_helpers/cmp.dm) for comparison.
#define ADD_SORTED(list, A, cmp_proc) if(!list.len) {list.Add(A)} else {list.Insert(FindElementIndex(A, list, cmp_proc), A)}
Expand Down
1 change: 0 additions & 1 deletion code/_onclick/click_hold.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@

/client/MouseDrop(datum/src_object, datum/over_object, src_location, over_location, src_control, over_control, params)
. = ..()

if(over_object)
SEND_SIGNAL(over_object, COMSIG_ATOM_DROPPED_ON, src_object, src)

Expand Down
1 change: 1 addition & 0 deletions code/_onclick/drag_drop.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
/atom/MouseDrop(atom/over)
if(!usr || !over) return

if(!Adjacent(usr) || !over.Adjacent(usr)) return // should stop you from dragging through windows

spawn(0)
Expand Down
6 changes: 6 additions & 0 deletions code/_onclick/hud/fullscreen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@
icon_state = "passage"
layer = FULLSCREEN_CRIT_LAYER

/atom/movable/screen/fullscreen/crit/dark
color = COLOR_GRAY

/atom/movable/screen/fullscreen/blind
icon_state = "blackimageoverlay"
layer = FULLSCREEN_BLIND_LAYER
Expand All @@ -127,6 +130,9 @@
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "noise"

/atom/movable/screen/fullscreen/flash/dark
icon_state = "black"

/atom/movable/screen/fullscreen/high
icon = 'icons/mob/hud/screen1.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
Expand Down
44 changes: 8 additions & 36 deletions code/controllers/subsystem/garbage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,6 @@ SUBSYSTEM_DEF(garbage)
pass_counts[i] = 0
fail_counts[i] = 0

#ifdef EXPERIMENT_515_QDEL_HARD_REFERENCE
// 1 from the hard reference in the queue, and 1 from the variable used before this
#define IS_DELETED(datum, _) (refcount(##datum) == 2)
#else
#define IS_DELETED(datum, gcd_at_time) (isnull(##datum) || ##datum.gc_destroyed != gcd_at_time)
#endif

/datum/controller/subsystem/garbage/proc/HandleQueue(level = GC_QUEUE_FILTER)
if (level == GC_QUEUE_FILTER)
delslasttick = 0
Expand All @@ -162,7 +155,7 @@ SUBSYSTEM_DEF(garbage)

lastlevel = level

//We do this rather then for(var/refID in queue) because that sort of for loop copies the whole list.
//We do this rather then for(var/list/ref_info in queue) because that sort of for loop copies the whole list.
//Normally this isn't expensive, but the gc queue can grow to 40k items, and that gets costly/causes overrun.
for (var/i in 1 to length(queue))
var/list/L = queue[i]
Expand All @@ -173,21 +166,15 @@ SUBSYSTEM_DEF(garbage)
continue

var/queued_at_time = L[GC_QUEUE_ITEM_QUEUE_TIME]

if(queued_at_time > cut_off_time)
break // Everything else is newer, skip them
count++

#ifdef EXPERIMENT_515_QDEL_HARD_REFERENCE
var/datum/D = L[GC_QUEUE_ITEM_REF]
#else
var/GCd_at_time = L[GC_QUEUE_ITEM_GCD_DESTROYED]
var/refID = L[GC_QUEUE_ITEM_REF]
var/datum/D
D = locate(refID)
#endif

if (IS_DELETED(D, GCd_at_time)) // So if something else coincidently gets the same ref, it's not deleted by mistake

// 1 from the hard reference in the queue, and 1 from the variable used before this
// If that's all we've got, send er off
if (refcount(D) == 2)
++gcedlasttick
++totalgcs
pass_counts[level]++
Expand Down Expand Up @@ -221,11 +208,7 @@ SUBSYSTEM_DEF(garbage)
var/type = D.type
var/datum/qdel_item/I = items[type]

var/message = "## TESTING: GC: -- [text_ref(D)] | [type] was unable to be GC'd --"
#if DM_VERSION >= 515
message = "[message] (ref count of [refcount(D)])"
#endif
log_world(message)
log_world("## TESTING: GC: -- [text_ref(D)] | [type] was unable to be GC'd -- (ref count of [refcount(D)])")

#ifdef TESTING
for(var/c in GLOB.admins) //Using testing() here would fill the logs with ADMIN_VV garbage
Expand Down Expand Up @@ -261,8 +244,6 @@ SUBSYSTEM_DEF(garbage)
queue.Cut(1,count+1)
count = 0

#undef IS_DELETED

/datum/controller/subsystem/garbage/proc/Queue(datum/D, level = GC_QUEUE_FILTER)
if (isnull(D))
return
Expand All @@ -271,20 +252,11 @@ SUBSYSTEM_DEF(garbage)
return
var/queue_time = world.time

#ifdef EXPERIMENT_515_QDEL_HARD_REFERENCE
var/refid = D
#else
var/refid = text_ref(D)
#endif

var/static/uid = 0
uid = WRAP(uid+1, 1, SHORT_REAL_LIMIT - 1)
if (D.gc_destroyed <= 0)
D.gc_destroyed = uid
D.gc_destroyed = queue_time

var/list/queue = queues[level]

queue[++queue.len] = list(queue_time, refid, D.gc_destroyed) // not += for byond reasons
queue[++queue.len] = list(queue_time, D, D.gc_destroyed) // not += for byond reasons

//this is mainly to separate things profile wise.
/datum/controller/subsystem/garbage/proc/HardDelete(datum/D, force)
Expand Down
2 changes: 2 additions & 0 deletions code/controllers/subsystem/hijack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ SUBSYSTEM_DEF(hijack)

if(hijack_status < HIJACK_OBJECTIVES_STARTED)
hijack_status = HIJACK_OBJECTIVES_STARTED
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_FUEL_PUMP_UPDATE)

if(current_progress >= required_progress)
if(hijack_status < HIJACK_OBJECTIVES_COMPLETE)
Expand Down Expand Up @@ -157,6 +158,7 @@ SUBSYSTEM_DEF(hijack)
if(current_progress >= announce_checkpoint)
announce_progress()
announce_checkpoint += initial(announce_checkpoint)
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_FUEL_PUMP_UPDATE)

current_run_progress_additive = 0
current_run_progress_multiplicative = 1
Expand Down
Loading

0 comments on commit 64d1351

Please sign in to comment.