515 Compat (#17465)

* ONLY SKYRAT CHANGES

* ACTUALLY SKYRAT CHANGES

* yolo, revert later

* Update alternate_byond_versions.txt

Co-authored-by: AnturK <AnturK@users.noreply.github.com>
This commit is contained in:
Zonespace
2022-11-14 22:59:06 -08:00
committed by GitHub
parent 5b56f43ff5
commit f7c26bbf25
1577 changed files with 5030 additions and 4847 deletions

View File

@@ -6,5 +6,5 @@
# Example:
# 500.1337: runtimestation
# AnturK uncomment this and then remove this line
# 515.1594: runtimestation
# Commented out until 515 is fully ready
# 515.1595: runtimestation

View File

@@ -258,7 +258,7 @@ Here's an example
UnregisterSignal(target, COMSIG_PARENT_QDELETING) //We need to make sure any old signals are cleared
target = new_target
if(target)
RegisterSignal(target, COMSIG_PARENT_QDELETING, .proc/clear_target) //Call clear_target if target is ever qdel()'d
RegisterSignal(target, COMSIG_PARENT_QDELETING, PROC_REF(clear_target)) //Call clear_target if target is ever qdel()'d
/somemob/proc/clear_target(datum/source)
SIGNAL_HANDLER

View File

@@ -99,6 +99,50 @@ While we normally encourage (and in some cases, even require) bringing out of da
### RegisterSignal()
#### PROC_REF Macros
When referencing procs in RegisterSignal, Callback and other procs you should use PROC_REF,TYPE_PROC_REF and GLOBAL_PROC_REF macros.
They ensure compilation fails if the reffered to procs change names or get removed.
The macro to be used depends on how the proc you're in relates to the proc you want to use:
PROC_REF if the proc you want to use is defined on the current proc type or any of it's ancestor types.
Example:
```
/mob/proc/funny()
to_chat(world,"knock knock")
/mob/subtype/proc/very_funny()
to_chat(world,"who's there?")
/mob/subtype/proc/do_something()
// Proc on our own type
RegisterSignal(x, COMSIG_OTHER_FAKE, PROC_REF(very_funny))
// Proc on ancestor type, /mob is parent type of /mob/subtype
RegisterSignal(x, COMSIG_FAKE, PROC_REF(funny))
```
TYPE_PROC_REF if the proc you want to use is defined on a different unrelated type
Example:
```
/obj/thing/proc/funny()
to_chat(world,"knock knock")
/mob/subtype/proc/do_something()
var/obj/thing/x = new()
// we're referring to /obj/thing proc inside /mob/subtype proc
RegisterSignal(x, COMSIG_FAKE, TYPE_PROC_REF(/obj/thing, funny))
```
GLOBAL_PROC_REF if the proc you want to use is a global proc.
Example:
```
/proc/funny()
to_chat(world,"knock knock")
/mob/subtype/proc/do_something()
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(funny)), 100))
```
#### Signal Handlers
All procs that are registered to listen for signals using `RegisterSignal()` must contain at the start of the proc `SIGNAL_HANDLER` eg;
@@ -116,7 +160,7 @@ Any sleeping behaviour that you need to perform inside a `SIGNAL_HANDLER` proc m
Each atom can only register a signal on the same object once, or else you will get a runtime. Overriding signals is usually a bug, but if you are confident that it is not, you can silence this runtime with `override = TRUE`.
```dm
RegisterSignal(fork, COMSIG_FORK_STAB, .proc/on_fork_stab, override = TRUE)
RegisterSignal(fork, COMSIG_FORK_STAB, PROC_REF(on_fork_stab), override = TRUE)
```
If you decide to do this, you should make it clear with a comment explaining why it is necessary. This helps us to understand that the signal override is not a bug, and may help us to remove it in the future if the assumptions change.

View File

@@ -0,0 +1,17 @@
# This workflow was added in the 515 compatibility PR - https://github.com/tgstation/tgstation/pull/71161
# By having this in your repository, we know that you have that PR merged as well.
# This will be REMOVED when 515 is fully compatible and ready, but for now we need this
# to prevent merge skew.
# In the future, this will be a more proper system where commits can be added into a text file,
# but that's a lot more difficult and I'm in a huge time crunch right now.
name: "515 Compatibility Pass"
on:
pull_request:
branches:
- master
jobs:
has_515_compatibility:
name: Has 515 Compatibility
runs-on: ubuntu-20.04
steps:
- run: echo "You're ready to go!"

View File

@@ -68,7 +68,7 @@
#define COMSIG_CD_STOP(cd_index) "cooldown_[cd_index]"
#define COMSIG_CD_RESET(cd_index) "cd_reset_[cd_index]"
#define TIMER_COOLDOWN_START(cd_source, cd_index, cd_time) LAZYSET(cd_source.cooldowns, cd_index, addtimer(CALLBACK(GLOBAL_PROC, /proc/end_cooldown, cd_source, cd_index), cd_time))
#define TIMER_COOLDOWN_START(cd_source, cd_index, cd_time) LAZYSET(cd_source.cooldowns, cd_index, addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(end_cooldown), cd_source, cd_index), cd_time))
#define TIMER_COOLDOWN_CHECK(cd_source, cd_index) LAZYACCESS(cd_source.cooldowns, cd_index)
@@ -81,7 +81,7 @@
* A bit more expensive than the regular timers, but can be reset before they end and the time left can be checked.
*/
#define S_TIMER_COOLDOWN_START(cd_source, cd_index, cd_time) LAZYSET(cd_source.cooldowns, cd_index, addtimer(CALLBACK(GLOBAL_PROC, /proc/end_cooldown, cd_source, cd_index), cd_time, TIMER_STOPPABLE))
#define S_TIMER_COOLDOWN_START(cd_source, cd_index, cd_time) LAZYSET(cd_source.cooldowns, cd_index, addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(end_cooldown), cd_source, cd_index), cd_time, TIMER_STOPPABLE))
#define S_TIMER_COOLDOWN_RESET(cd_source, cd_index) reset_cooldown(cd_source, cd_index)

View File

@@ -46,10 +46,10 @@
#define QDELETED(X) (!X || QDELING(X))
#define QDESTROYING(X) (!X || X.gc_destroyed == GC_CURRENTLY_BEING_QDELETED)
#define QDEL_IN(item, time) addtimer(CALLBACK(GLOBAL_PROC, .proc/qdel, (time) > GC_FILTER_QUEUE ? WEAKREF(item) : item), time, TIMER_STOPPABLE)
#define QDEL_IN_CLIENT_TIME(item, time) addtimer(CALLBACK(GLOBAL_PROC, .proc/qdel, item), time, TIMER_STOPPABLE | TIMER_CLIENT_TIME)
#define QDEL_IN(item, time) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), (time) > GC_FILTER_QUEUE ? WEAKREF(item) : item), time, TIMER_STOPPABLE)
#define QDEL_IN_CLIENT_TIME(item, time) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), item), time, TIMER_STOPPABLE | TIMER_CLIENT_TIME)
#define QDEL_NULL(item) qdel(item); item = null
#define QDEL_LIST(L) if(L) { for(var/I in L) qdel(I); L.Cut(); }
#define QDEL_LIST_IN(L, time) addtimer(CALLBACK(GLOBAL_PROC, .proc/______qdel_list_wrapper, L), time, TIMER_STOPPABLE)
#define QDEL_LIST_IN(L, time) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(______qdel_list_wrapper), L), time, TIMER_STOPPABLE)
#define QDEL_LIST_ASSOC(L) if(L) { for(var/I in L) { qdel(L[I]); qdel(I); } L.Cut(); }
#define QDEL_LIST_ASSOC_VAL(L) if(L) { for(var/I in L) qdel(L[I]); L.Cut(); }

View File

@@ -6,7 +6,7 @@ GLOBAL_LIST_EMPTY(auxtools_initialized)
#define AUXTOOLS_CHECK(LIB)\
if (GLOB.auxtools_initialized[LIB] != AUXTOOLS_FULL_INIT) {\
if (fexists(LIB)) {\
var/string = call(LIB,"auxtools_init")();\
var/string = LIBCALL(LIB,"auxtools_init")();\
if(findtext(string, "SUCCESS")) {\
GLOB.auxtools_initialized[LIB] = AUXTOOLS_FULL_INIT;\
} else {\
@@ -19,12 +19,12 @@ GLOBAL_LIST_EMPTY(auxtools_initialized)
#define AUXTOOLS_SHUTDOWN(LIB)\
if (GLOB.auxtools_initialized[LIB] == AUXTOOLS_FULL_INIT && fexists(LIB)){\
call(LIB,"auxtools_shutdown")();\
LIBCALL(LIB,"auxtools_shutdown")();\
GLOB.auxtools_initialized[LIB] = AUXTOOLS_PARTIAL_INIT;\
}\
#define AUXTOOLS_FULL_SHUTDOWN(LIB)\
if (GLOB.auxtools_initialized[LIB] && fexists(LIB)){\
call(LIB,"auxtools_full_shutdown")();\
LIBCALL(LIB,"auxtools_full_shutdown")();\
GLOB.auxtools_initialized[LIB] = FALSE;\
}\

View File

@@ -550,12 +550,12 @@
///for sorting clients or mobs by ckey
/proc/sort_key(list/ckey_list, order=1)
return sortTim(ckey_list, order >= 0 ? /proc/cmp_ckey_asc : /proc/cmp_ckey_dsc)
return sortTim(ckey_list, order >= 0 ? GLOBAL_PROC_REF(cmp_ckey_asc) : GLOBAL_PROC_REF(cmp_ckey_dsc))
///Specifically for record datums in a list.
/proc/sort_record(list/record_list, field = "name", order = 1)
GLOB.cmp_field = field
return sortTim(record_list, order >= 0 ? /proc/cmp_records_asc : /proc/cmp_records_dsc)
return sortTim(record_list, order >= 0 ? GLOBAL_PROC_REF(cmp_records_asc) : GLOBAL_PROC_REF(cmp_records_dsc))
///sort any value in a list
/proc/sort_list(list/list_to_sort, cmp=/proc/cmp_text_asc)
@@ -563,7 +563,7 @@
///uses sort_list() but uses the var's name specifically. This should probably be using mergeAtom() instead
/proc/sort_names(list/list_to_sort, order=1)
return sortTim(list_to_sort.Copy(), order >= 0 ? /proc/cmp_name_asc : /proc/cmp_name_dsc)
return sortTim(list_to_sort.Copy(), order >= 0 ? GLOBAL_PROC_REF(cmp_name_asc) : GLOBAL_PROC_REF(cmp_name_dsc))
///Converts a bitfield to a list of numbers (or words if a wordlist is provided)
/proc/bitfield_to_list(bitfield = 0, list/wordlist)
@@ -836,7 +836,7 @@
else
. += list(recursive_list_resolve_element(element))
///Helper for /proc/recursive_list_resolve
///Helper for recursive_list_resolve()
/proc/recursive_list_resolve_element(element)
if(islist(element))
var/list/inner_list = element
@@ -1039,7 +1039,7 @@
return ret
/// Runtimes if the passed in list is not sorted
/proc/assert_sorted(list/list, name, cmp = /proc/cmp_numeric_asc)
/proc/assert_sorted(list/list, name, cmp = GLOBAL_PROC_REF(cmp_numeric_asc))
var/last_value = list[1]
for (var/index in 2 to list.len)

View File

@@ -14,7 +14,7 @@ GLOBAL_VAR(string_filename_current_key)
if((filepath in GLOB.string_cache) && (key in GLOB.string_cache[filepath]))
var/response = pick(GLOB.string_cache[filepath][key])
var/regex/r = regex("@pick\\((\\D+?)\\)", "g")
response = r.Replace(response, /proc/strings_subkey_lookup)
response = r.Replace(response, GLOBAL_PROC_REF(strings_subkey_lookup))
return response
else
CRASH("strings list not found: [STRING_DIRECTORY]/[filepath], index=[key]")

View File

@@ -150,11 +150,11 @@ GLOBAL_LIST_INIT(typecache_powerfailure_safe_areas, typecacheof(/area/station/en
for(var/area/A in world)
GLOB.sortedAreas.Add(A)
sortTim(GLOB.sortedAreas, /proc/cmp_name_asc)
sortTim(GLOB.sortedAreas, GLOBAL_PROC_REF(cmp_name_asc))
/area/proc/addSorted()
GLOB.sortedAreas.Add(src)
sortTim(GLOB.sortedAreas, /proc/cmp_name_asc)
sortTim(GLOB.sortedAreas, GLOBAL_PROC_REF(cmp_name_asc))
//Takes: Area type as a text string from a variable.
//Returns: Instance for the area in the world.

View File

@@ -126,7 +126,7 @@
/proc/flick_overlay(image/image_to_show, list/show_to, duration)
for(var/client/add_to in show_to)
add_to.images += image_to_show
addtimer(CALLBACK(GLOBAL_PROC, /proc/remove_images_from_clients, image_to_show, show_to), duration, TIMER_CLIENT_TIME)
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(remove_images_from_clients), image_to_show, show_to), duration, TIMER_CLIENT_TIME)
///wrapper for flick_overlay(), flicks to everyone who can see the target atom
/proc/flick_overlay_view(image/image_to_show, atom/target, duration)

View File

@@ -42,25 +42,25 @@
for(var/spath in subtypesof(/datum/scream_type))
var/datum/scream_type/S = new spath()
GLOB.scream_types[S.name] = spath
sort_list(GLOB.scream_types, /proc/cmp_typepaths_asc)
sort_list(GLOB.scream_types, GLOBAL_PROC_REF(cmp_typepaths_asc))
//Laugh types
for(var/spath in subtypesof(/datum/laugh_type))
var/datum/laugh_type/L = new spath()
GLOB.laugh_types[L.name] = spath
sort_list(GLOB.laugh_types, /proc/cmp_typepaths_asc)
sort_list(GLOB.laugh_types, GLOBAL_PROC_REF(cmp_typepaths_asc))
//SKYRAT EDIT END
//Species
for(var/spath in subtypesof(/datum/species))
var/datum/species/S = new spath()
GLOB.species_list[S.id] = spath
sort_list(GLOB.species_list, /proc/cmp_typepaths_asc)
sort_list(GLOB.species_list, GLOBAL_PROC_REF(cmp_typepaths_asc))
//Surgeries
for(var/path in subtypesof(/datum/surgery))
GLOB.surgeries_list += new path()
sort_list(GLOB.surgeries_list, /proc/cmp_typepaths_asc)
sort_list(GLOB.surgeries_list, GLOBAL_PROC_REF(cmp_typepaths_asc))
// Hair Gradients - Initialise all /datum/sprite_accessory/hair_gradient into an list indexed by gradient-style name
for(var/path in subtypesof(/datum/sprite_accessory/gradient))
@@ -82,7 +82,7 @@
/proc/init_crafting_recipes(list/crafting_recipes)
for(var/path in subtypesof(/datum/crafting_recipe))
var/datum/crafting_recipe/recipe = new path()
recipe.reqs = sort_list(recipe.reqs, /proc/cmp_crafting_req_priority)
recipe.reqs = sort_list(recipe.reqs, GLOBAL_PROC_REF(cmp_crafting_req_priority))
crafting_recipes += recipe
return crafting_recipes

View File

@@ -135,7 +135,7 @@ GLOBAL_LIST_INIT(random_hallucination_weighted_list, generate_hallucination_weig
last_type_weight = this_weight
// Sort by weight descending, where weight is the values (not the keys). We assoc_to_keys later to get JUST the text
all_weights = sortTim(all_weights, /proc/cmp_numeric_dsc, associative = TRUE)
all_weights = sortTim(all_weights, GLOBAL_PROC_REF(cmp_numeric_dsc), associative = TRUE)
var/page_style = "<style>table, th, td {border: 1px solid black;border-collapse: collapse;}</style>"
var/page_contents = "[page_style]<table style=\"width:100%\">[header][jointext(assoc_to_keys(all_weights), "")]</table>"

View File

@@ -17,7 +17,7 @@
if(!check_mob?.mind || !check_mob.client)
continue
// maybe some other filters like bans or whatever
INVOKE_ASYNC(check_mob, /mob.proc/query_heart, 1)
INVOKE_ASYNC(check_mob, TYPE_PROC_REF(/mob, query_heart), 1)
number_to_ask--
if(number_to_ask <= 0)
break

View File

@@ -1342,7 +1342,7 @@ GLOBAL_LIST_EMPTY(transformation_animation_objects)
GLOB.transformation_animation_objects[src] = transformation_objects
for(var/A in transformation_objects)
vis_contents += A
addtimer(CALLBACK(src,.proc/_reset_transformation_animation,filter_index),time)
addtimer(CALLBACK(src, PROC_REF(_reset_transformation_animation),filter_index),time)
/*
* Resets filters and removes transformation animations helper objects from vis contents.

View File

@@ -4,3 +4,12 @@
* datum may be null, but it does need to be a typed var.
**/
#define NAMEOF(datum, X) (#X || ##datum.##X)
/**
* 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

View File

@@ -70,7 +70,7 @@
to_chat(mob_to_teleport, announcement)
SEND_SOUND(mob_to_teleport, meeting_sound) //no preferences here, you must hear the funny sound
mob_to_teleport.overlay_fullscreen("emergency_meeting", /atom/movable/screen/fullscreen/emergency_meeting, 1)
addtimer(CALLBACK(mob_to_teleport, /mob/.proc/clear_fullscreen, "emergency_meeting"), 3 SECONDS)
addtimer(CALLBACK(mob_to_teleport, TYPE_PROC_REF(/mob/, clear_fullscreen), "emergency_meeting"), 3 SECONDS)
if (is_station_level(mob_to_teleport.z)) //teleport the mob to the crew meeting
var/turf/target

View File

@@ -631,7 +631,7 @@
var/currrent_category
var/datum/antagonist/previous_category
sortTim(all_antagonists, /proc/cmp_antag_category)
sortTim(all_antagonists, GLOBAL_PROC_REF(cmp_antag_category))
for(var/datum/antagonist/antagonists in all_antagonists)
if(!antagonists.show_in_roundend)

View File

@@ -8,14 +8,14 @@
//When we get into galloping mode, we stay there until both runs win less often than MIN_GALLOP consecutive times.
#define MIN_GALLOP 7
//This is a global instance to allow much of this code to be reused. The interfaces are kept separately
//This is a global instance to allow much of this code to be reused. The interfaces are kept separately
GLOBAL_DATUM_INIT(sortInstance, /datum/sort_instance, new())
/datum/sort_instance
//The array being sorted.
var/list/L
//The comparator proc-reference
var/cmp = /proc/cmp_numeric_asc
var/cmp = GLOBAL_PROC_REF(cmp_numeric_asc)
//whether we are sorting list keys (0: L[i]) or associated values (1: L[L[i]])
var/associative = 0

View File

@@ -1,4 +1,4 @@
/proc/render_stats(list/stats, user, sort = /proc/cmp_generic_stat_item_time)
/proc/render_stats(list/stats, user, sort = GLOBAL_PROC_REF(cmp_generic_stat_item_time))
sortTim(stats, sort, TRUE)
var/list/lines = list()

View File

@@ -1,5 +1,5 @@
#define TRAIT_CALLBACK_ADD(target, trait, source) CALLBACK(GLOBAL_PROC, /proc/___TraitAdd, ##target, ##trait, ##source)
#define TRAIT_CALLBACK_REMOVE(target, trait, source) CALLBACK(GLOBAL_PROC, /proc/___TraitRemove, ##target, ##trait, ##source)
#define TRAIT_CALLBACK_ADD(target, trait, source) CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(___TraitAdd), ##target, ##trait, ##source)
#define TRAIT_CALLBACK_REMOVE(target, trait, source) CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(___TraitRemove), ##target, ##trait, ##source)
///DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback.
/proc/___TraitAdd(target,trait,source)

View File

@@ -1,6 +1,6 @@
#define VARSET_LIST_CALLBACK(target, var_name, var_value) CALLBACK(GLOBAL_PROC, /proc/___callbackvarset, ##target, ##var_name, ##var_value)
#define VARSET_LIST_CALLBACK(target, var_name, var_value) CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(___callbackvarset), ##target, ##var_name, ##var_value)
//dupe code because dm can't handle 3 level deep macros
#define VARSET_CALLBACK(datum, var, var_value) CALLBACK(GLOBAL_PROC, /proc/___callbackvarset, ##datum, NAMEOF(##datum, ##var), ##var_value)
#define VARSET_CALLBACK(datum, var, var_value) CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(___callbackvarset), ##datum, NAMEOF(##datum, ##var), ##var_value)
/proc/___callbackvarset(list_or_datum, var_name, var_value)
if(length(list_or_datum))

View File

@@ -0,0 +1,53 @@
// 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 1556
#if (DM_VERSION < MIN_COMPILER_VERSION || DM_BUILD < MIN_COMPILER_BUILD) && !defined(SPACEMAN_DMM)
//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.1556 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
// Temporary 515 block until it is completely compatible.
// AnturK says there are issues with savefiles that would make it dangerous to test merge,
// and so this check is in place to stop serious damage.
// That being said, if you really are ready, you can give YES_I_WANT_515 to TGS.
#if !defined(YES_I_WANT_515) && DM_VERSION >= 515
#error We do not yet completely support BYOND 515.
#endif
// 515 split call for external libraries into call_ext
#if DM_VERSION < 515
#define LIBCALL call
#else
#define LIBCALL call_ext
#endif
// So we want to have compile time guarantees these procs exist on local type, unfortunately 515 killed the .proc/procname syntax so we have to use nameof()
#if DM_VERSION < 515
/// Call by name proc reference, checks if the proc exists on this type or as a global proc
#define PROC_REF(X) (.proc/##X)
/// Call by name proc reference, checks if the proc exists on given type or as a global proc
#define TYPE_PROC_REF(TYPE, X) (##TYPE.proc/##X)
/// Call by name proc reference, checks if the proc is existing global proc
#define GLOBAL_PROC_REF(X) (/proc/##X)
#else
/// Call by name proc reference, checks if the proc exists on this type or as a global proc
#define PROC_REF(X) (nameof(.proc/##X))
/// Call by name proc reference, checks if the proc exists on given type or as a global proc
#define TYPE_PROC_REF(TYPE, X) (nameof(##TYPE.proc/##X))
/// Call by name proc reference, checks if the proc is existing global proc
#define GLOBAL_PROC_REF(X) (/proc/##X)
#endif

View File

@@ -90,21 +90,6 @@
#define FORCE_MAP_DIRECTORY "_maps"
#endif
//Update this whenever you need to take advantage of more recent byond features
#define MIN_COMPILER_VERSION 514
#define MIN_COMPILER_BUILD 1557 //SKYRAT EDIT CHANGE - Compiler failure due to insufficent memory when running previous builds.
#if (DM_VERSION < MIN_COMPILER_VERSION || DM_BUILD < MIN_COMPILER_BUILD) && !defined(SPACEMAN_DMM)
//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.1556 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
//Additional code for the above flags.
#ifdef TESTING
#warn compiling in TESTING mode. testing() debug messages will be visible.

View File

@@ -9,5 +9,5 @@
/datum/debugger/proc/enable_debugger()
var/dll = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL")
if (dll)
call(dll, "auxtools_init")()
LIBCALL(dll, "auxtools_init")()
enable_debugging()

View File

@@ -532,7 +532,7 @@
/atom/movable/screen/click_catcher/Initialize(mapload)
. = ..()
RegisterSignal(SSmapping, COMSIG_PLANE_OFFSET_INCREASE, .proc/offset_increased)
RegisterSignal(SSmapping, COMSIG_PLANE_OFFSET_INCREASE, PROC_REF(offset_increased))
offset_increased(SSmapping, 0, SSmapping.max_plane_offset)
// Draw to the lowest plane level offered

View File

@@ -247,7 +247,7 @@ GLOBAL_LIST_INIT(palette_removed_matrix, list(1.4,0,0,0, 0.7,0.4,0,0, 0.4,0,0.6,
if(color_timer_id)
return
add_atom_colour(color, TEMPORARY_COLOUR_PRIORITY) //We unfortunately cannot animate matrix colors. Curse you lummy it would be ~~non~~trivial to interpolate between the two valuessssssssss
color_timer_id = addtimer(CALLBACK(src, .proc/remove_color, color), 2 SECONDS)
color_timer_id = addtimer(CALLBACK(src, PROC_REF(remove_color), color), 2 SECONDS)
/atom/movable/screen/button_palette/proc/remove_color(list/to_remove)
color_timer_id = null
@@ -297,7 +297,7 @@ GLOBAL_LIST_INIT(palette_removed_matrix, list(1.4,0,0,0, 0.7,0.4,0,0, 0.4,0,0.6,
return
if(expanded)
RegisterSignal(usr.client, COMSIG_CLIENT_CLICK, .proc/clicked_while_open)
RegisterSignal(usr.client, COMSIG_CLIENT_CLICK, PROC_REF(clicked_while_open))
else
UnregisterSignal(usr.client, COMSIG_CLIENT_CLICK)

View File

@@ -64,7 +64,7 @@
animate(thealert, transform = matrix(), time = 2.5, easing = CUBIC_EASING)
if(thealert.timeout)
addtimer(CALLBACK(src, .proc/alert_timeout, thealert, category), thealert.timeout)
addtimer(CALLBACK(src, PROC_REF(alert_timeout), thealert, category), thealert.timeout)
thealert.timeout = world.time + thealert.timeout - world.tick_lag
return thealert
@@ -346,7 +346,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
. = ..()
name = "[offerer] is offering a high-five!"
desc = "[offerer] is offering a high-five! Click this alert to slap it."
RegisterSignal(offerer, COMSIG_PARENT_EXAMINE_MORE, .proc/check_fake_out)
RegisterSignal(offerer, COMSIG_PARENT_EXAMINE_MORE, PROC_REF(check_fake_out))
/atom/movable/screen/alert/give/highfive/handle_transfer()
var/mob/living/carbon/taker = owner
@@ -365,7 +365,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
offerer.visible_message(span_notice("[rube] rushes in to high-five [offerer], but-"), span_nicegreen("[rube] falls for your trick just as planned, lunging for a high-five that no longer exists! Classic!"), ignored_mobs=rube)
to_chat(rube, span_nicegreen("You go in for [offerer]'s high-five, but-"))
addtimer(CALLBACK(src, .proc/too_slow_p2, offerer, rube), 0.5 SECONDS)
addtimer(CALLBACK(src, PROC_REF(too_slow_p2), offerer, rube), 0.5 SECONDS)
/// Part two of the ultimate prank
/atom/movable/screen/alert/give/highfive/proc/too_slow_p2()

View File

@@ -53,7 +53,7 @@
animate(src, transform = M, time = CREDIT_ROLL_SPEED)
target = M
animate(src, alpha = 255, time = CREDIT_EASE_DURATION, flags = ANIMATION_PARALLEL)
addtimer(CALLBACK(src, .proc/FadeOut), CREDIT_ROLL_SPEED - CREDIT_EASE_DURATION)
addtimer(CALLBACK(src, PROC_REF(FadeOut)), CREDIT_ROLL_SPEED - CREDIT_EASE_DURATION)
QDEL_IN(src, CREDIT_ROLL_SPEED)
if(parent)
parent.screen += src

View File

@@ -27,7 +27,7 @@
if(animated)
animate(screen, alpha = 0, time = animated)
addtimer(CALLBACK(src, .proc/clear_fullscreen_after_animate, screen), animated, TIMER_CLIENT_TIME)
addtimer(CALLBACK(src, PROC_REF(clear_fullscreen_after_animate), screen), animated, TIMER_CLIENT_TIME)
else
if(client)
client.screen -= screen

View File

@@ -149,15 +149,15 @@ GLOBAL_LIST_INIT(available_erp_ui_styles, list(
owner.overlay_fullscreen("see_through_darkness", /atom/movable/screen/fullscreen/see_through_darkness)
RegisterSignal(SSmapping, COMSIG_PLANE_OFFSET_INCREASE, .proc/on_plane_increase)
RegisterSignal(mymob, COMSIG_MOB_LOGIN, .proc/client_refresh)
RegisterSignal(mymob, COMSIG_MOB_LOGOUT, .proc/clear_client)
RegisterSignal(mymob, COMSIG_MOB_SIGHT_CHANGE, .proc/update_sightflags)
RegisterSignal(mymob, COMSIG_VIEWDATA_UPDATE, .proc/on_viewdata_update)
RegisterSignal(SSmapping, COMSIG_PLANE_OFFSET_INCREASE, PROC_REF(on_plane_increase))
RegisterSignal(mymob, COMSIG_MOB_LOGIN, PROC_REF(client_refresh))
RegisterSignal(mymob, COMSIG_MOB_LOGOUT, PROC_REF(clear_client))
RegisterSignal(mymob, COMSIG_MOB_SIGHT_CHANGE, PROC_REF(update_sightflags))
RegisterSignal(mymob, COMSIG_VIEWDATA_UPDATE, PROC_REF(on_viewdata_update))
update_sightflags(mymob, mymob.sight, NONE)
/datum/hud/proc/client_refresh(datum/source)
RegisterSignal(mymob.client, COMSIG_CLIENT_SET_EYE, .proc/on_eye_change)
RegisterSignal(mymob.client, COMSIG_CLIENT_SET_EYE, PROC_REF(on_eye_change))
on_eye_change(null, null, mymob.client.eye)
/datum/hud/proc/clear_client(datum/source)
@@ -177,7 +177,7 @@ GLOBAL_LIST_INIT(available_erp_ui_styles, list(
// By the time logout runs, the client's eye has already changed
// There's just no log of the old eye, so we need to override
// :sadkirby:
RegisterSignal(new_eye, COMSIG_MOVABLE_Z_CHANGED, .proc/eye_z_changed, override = TRUE)
RegisterSignal(new_eye, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(eye_z_changed), override = TRUE)
eye_z_changed(new_eye)
/datum/hud/proc/update_sightflags(datum/source, new_sight, old_sight)

View File

@@ -127,10 +127,10 @@
. = ..()
switch(SSticker.current_state)
if(GAME_STATE_PREGAME, GAME_STATE_STARTUP)
RegisterSignal(SSticker, COMSIG_TICKER_ENTER_SETTING_UP, .proc/hide_ready_button)
RegisterSignal(SSticker, COMSIG_TICKER_ENTER_SETTING_UP, PROC_REF(hide_ready_button))
if(GAME_STATE_SETTING_UP)
set_button_status(FALSE)
RegisterSignal(SSticker, COMSIG_TICKER_ERROR_SETTING_UP, .proc/show_ready_button)
RegisterSignal(SSticker, COMSIG_TICKER_ERROR_SETTING_UP, PROC_REF(show_ready_button))
else
set_button_status(FALSE)
@@ -138,13 +138,13 @@
SIGNAL_HANDLER
set_button_status(FALSE)
UnregisterSignal(SSticker, COMSIG_TICKER_ENTER_SETTING_UP)
RegisterSignal(SSticker, COMSIG_TICKER_ERROR_SETTING_UP, .proc/show_ready_button)
RegisterSignal(SSticker, COMSIG_TICKER_ERROR_SETTING_UP, PROC_REF(show_ready_button))
/atom/movable/screen/lobby/button/ready/proc/show_ready_button()
SIGNAL_HANDLER
set_button_status(TRUE)
UnregisterSignal(SSticker, COMSIG_TICKER_ERROR_SETTING_UP)
RegisterSignal(SSticker, COMSIG_TICKER_ENTER_SETTING_UP, .proc/hide_ready_button)
RegisterSignal(SSticker, COMSIG_TICKER_ENTER_SETTING_UP, PROC_REF(hide_ready_button))
/atom/movable/screen/lobby/button/ready/Click(location, control, params)
. = ..()
@@ -179,10 +179,10 @@
. = ..()
switch(SSticker.current_state)
if(GAME_STATE_PREGAME, GAME_STATE_STARTUP)
RegisterSignal(SSticker, COMSIG_TICKER_ENTER_SETTING_UP, .proc/show_join_button)
RegisterSignal(SSticker, COMSIG_TICKER_ENTER_SETTING_UP, PROC_REF(show_join_button))
if(GAME_STATE_SETTING_UP)
set_button_status(TRUE)
RegisterSignal(SSticker, COMSIG_TICKER_ERROR_SETTING_UP, .proc/hide_join_button)
RegisterSignal(SSticker, COMSIG_TICKER_ERROR_SETTING_UP, PROC_REF(hide_join_button))
else
set_button_status(TRUE)
@@ -230,13 +230,13 @@
SIGNAL_HANDLER
set_button_status(TRUE)
UnregisterSignal(SSticker, COMSIG_TICKER_ENTER_SETTING_UP)
RegisterSignal(SSticker, COMSIG_TICKER_ERROR_SETTING_UP, .proc/hide_join_button)
RegisterSignal(SSticker, COMSIG_TICKER_ERROR_SETTING_UP, PROC_REF(hide_join_button))
/atom/movable/screen/lobby/button/join/proc/hide_join_button()
SIGNAL_HANDLER
set_button_status(FALSE)
UnregisterSignal(SSticker, COMSIG_TICKER_ERROR_SETTING_UP)
RegisterSignal(SSticker, COMSIG_TICKER_ENTER_SETTING_UP, .proc/show_join_button)
RegisterSignal(SSticker, COMSIG_TICKER_ENTER_SETTING_UP, PROC_REF(show_join_button))
/atom/movable/screen/lobby/button/observe
screen_loc = "TOP:-40,CENTER:-54"
@@ -250,7 +250,7 @@
if(SSticker.current_state > GAME_STATE_STARTUP)
set_button_status(TRUE)
else
RegisterSignal(SSticker, COMSIG_TICKER_ENTER_PREGAME, .proc/enable_observing)
RegisterSignal(SSticker, COMSIG_TICKER_ENTER_PREGAME, PROC_REF(enable_observing))
/atom/movable/screen/lobby/button/observe/Click(location, control, params)
. = ..()
@@ -263,7 +263,7 @@
SIGNAL_HANDLER
flick("[base_icon_state]_enabled", src)
set_button_status(TRUE)
UnregisterSignal(SSticker, COMSIG_TICKER_ENTER_PREGAME, .proc/enable_observing)
UnregisterSignal(SSticker, COMSIG_TICKER_ENTER_PREGAME, PROC_REF(enable_observing))
/atom/movable/screen/lobby/button/settings
icon = 'icons/hud/lobby/bottom_buttons.dmi'

View File

@@ -140,7 +140,7 @@
C.parallax_movedir = new_parallax_movedir
if (C.parallax_animate_timer)
deltimer(C.parallax_animate_timer)
var/datum/callback/CB = CALLBACK(src, .proc/update_parallax_motionblur, C, animatedir, new_parallax_movedir, newtransform)
var/datum/callback/CB = CALLBACK(src, PROC_REF(update_parallax_motionblur), C, animatedir, new_parallax_movedir, newtransform)
if(skip_windups)
CB.Invoke()
else
@@ -267,7 +267,7 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/parallax_layer)
// I do not want to know bestie
var/view = boss.view || world.view
update_o(view)
RegisterSignal(boss, COMSIG_VIEW_SET, .proc/on_view_change)
RegisterSignal(boss, COMSIG_VIEW_SET, PROC_REF(on_view_change))
/atom/movable/screen/parallax_layer/proc/on_view_change(datum/source, new_size)
SIGNAL_HANDLER
@@ -337,8 +337,8 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/parallax_layer)
if(!owner?.client)
return
var/static/list/connections = list(
COMSIG_MOVABLE_Z_CHANGED = .proc/on_z_change,
COMSIG_MOB_LOGOUT = .proc/on_mob_logout,
COMSIG_MOVABLE_Z_CHANGED = PROC_REF(on_z_change),
COMSIG_MOB_LOGOUT = PROC_REF(on_mob_logout),
)
AddComponent(/datum/component/connect_mob_behalf, owner.client, connections)
on_z_change(owner)

View File

@@ -16,7 +16,7 @@
/atom/movable/screen/movable/pic_in_pic/Initialize(mapload)
. = ..()
make_backgrounds()
RegisterSignal(SSmapping, COMSIG_PLANE_OFFSET_INCREASE, .proc/multiz_offset_increase)
RegisterSignal(SSmapping, COMSIG_PLANE_OFFSET_INCREASE, PROC_REF(multiz_offset_increase))
multiz_offset_increase(SSmapping)
/atom/movable/screen/movable/pic_in_pic/proc/multiz_offset_increase(datum/source)

View File

@@ -14,7 +14,7 @@ GLOBAL_LIST_EMPTY(radial_menus)
UnregisterSignal(parent, COMSIG_PARENT_QDELETING)
parent = new_value
if(parent)
RegisterSignal(parent, COMSIG_PARENT_QDELETING, .proc/handle_parent_del)
RegisterSignal(parent, COMSIG_PARENT_QDELETING, PROC_REF(handle_parent_del))
/atom/movable/screen/radial/proc/handle_parent_del()
SIGNAL_HANDLER

View File

@@ -176,7 +176,7 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/plane_master)
/atom/movable/screen/plane_master/clickcatcher/Initialize(mapload, datum/plane_master_group/home, offset)
. = ..()
RegisterSignal(SSmapping, COMSIG_PLANE_OFFSET_INCREASE, .proc/offset_increased)
RegisterSignal(SSmapping, COMSIG_PLANE_OFFSET_INCREASE, PROC_REF(offset_increased))
offset_increased(SSmapping, 0, SSmapping.max_plane_offset)
/atom/movable/screen/plane_master/clickcatcher/proc/offset_increased(datum/source, old_off, new_off)
@@ -211,7 +211,7 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/plane_master)
if(offset != 0)
// You aren't the source? don't change yourself
return
RegisterSignal(SSmapping, COMSIG_PLANE_OFFSET_INCREASE, .proc/on_offset_increase)
RegisterSignal(SSmapping, COMSIG_PLANE_OFFSET_INCREASE, PROC_REF(on_offset_increase))
offset_increase(0, SSmapping.max_plane_offset)
/atom/movable/screen/plane_master/parallax/proc/on_offset_increase(datum/source, old_offset, new_offset)
@@ -342,11 +342,11 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/plane_master)
if(offset != 0)
// You aren't the source? don't change yourself
return
RegisterSignal(mymob, COMSIG_MOB_SIGHT_CHANGE, .proc/handle_sight_value)
RegisterSignal(mymob, COMSIG_MOB_SIGHT_CHANGE, PROC_REF(handle_sight_value))
handle_sight_value(mymob, mymob.sight, 0)
var/datum/hud/hud = home.our_hud
if(hud)
RegisterSignal(hud, COMSIG_HUD_OFFSET_CHANGED, .proc/on_offset_change)
RegisterSignal(hud, COMSIG_HUD_OFFSET_CHANGED, PROC_REF(on_offset_change))
offset_change(0, hud?.current_plane_offset || 0)
/atom/movable/screen/plane_master/blackness/hide_from(mob/oldmob)
@@ -356,7 +356,7 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/plane_master)
UnregisterSignal(oldmob, COMSIG_MOB_SIGHT_CHANGE)
var/datum/hud/hud = home.our_hud
if(hud)
UnregisterSignal(hud, COMSIG_HUD_OFFSET_CHANGED, .proc/on_offset_change)
UnregisterSignal(hud, COMSIG_HUD_OFFSET_CHANGED, PROC_REF(on_offset_change))
/// Reacts to some new plane master value
/atom/movable/screen/plane_master/blackness/proc/handle_sight_value(datum/source, new_sight, old_sight)

View File

@@ -44,7 +44,7 @@
// Non 0 offset render plates will relay up to the transparent plane above them, assuming they're not on the same z level as their target of course
var/datum/hud/hud = home.our_hud
if(hud)
RegisterSignal(hud, COMSIG_HUD_OFFSET_CHANGED, .proc/on_offset_change)
RegisterSignal(hud, COMSIG_HUD_OFFSET_CHANGED, PROC_REF(on_offset_change))
offset_change(hud?.current_plane_offset || 0)
/atom/movable/screen/plane_master/rendering_plate/master/hide_from(mob/oldmob)
@@ -53,7 +53,7 @@
return
var/datum/hud/hud = home.our_hud
if(hud)
UnregisterSignal(hud, COMSIG_HUD_OFFSET_CHANGED, .proc/on_offset_change)
UnregisterSignal(hud, COMSIG_HUD_OFFSET_CHANGED, PROC_REF(on_offset_change))
/atom/movable/screen/plane_master/rendering_plate/master/proc/on_offset_change(datum/source, old_offset, new_offset)
SIGNAL_HANDLER
@@ -137,7 +137,7 @@
// If we don't our lower plane gets totally overriden by the black void of the upper plane
var/datum/hud/hud = home.our_hud
if(hud)
RegisterSignal(hud, COMSIG_HUD_OFFSET_CHANGED, .proc/on_offset_change)
RegisterSignal(hud, COMSIG_HUD_OFFSET_CHANGED, PROC_REF(on_offset_change))
offset_change(hud?.current_plane_offset || 0)
set_alpha(mymob.lighting_alpha)
@@ -148,7 +148,7 @@
oldmob.clear_fullscreen("lighting_backdrop_unlit")
var/datum/hud/hud = home.our_hud
if(hud)
UnregisterSignal(hud, COMSIG_HUD_OFFSET_CHANGED, .proc/on_offset_change)
UnregisterSignal(hud, COMSIG_HUD_OFFSET_CHANGED, PROC_REF(on_offset_change))
/atom/movable/screen/plane_master/rendering_plate/lighting/proc/on_offset_change(datum/source, old_offset, new_offset)
SIGNAL_HANDLER

View File

@@ -680,7 +680,7 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/splash)
/atom/movable/screen/combo/proc/clear_streak()
animate(src, alpha = 0, 2 SECONDS, SINE_EASING)
timerid = addtimer(CALLBACK(src, .proc/reset_icons), 2 SECONDS, TIMER_UNIQUE | TIMER_STOPPABLE)
timerid = addtimer(CALLBACK(src, PROC_REF(reset_icons)), 2 SECONDS, TIMER_UNIQUE | TIMER_STOPPABLE)
/atom/movable/screen/combo/proc/reset_icons()
cut_overlays()
@@ -693,7 +693,7 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/splash)
alpha = 255
if(!streak)
return ..()
timerid = addtimer(CALLBACK(src, .proc/clear_streak), time, TIMER_UNIQUE | TIMER_STOPPABLE)
timerid = addtimer(CALLBACK(src, PROC_REF(clear_streak)), time, TIMER_UNIQUE | TIMER_STOPPABLE)
icon_state = "combo"
for(var/i = 1; i <= length(streak); ++i)
var/intent_text = copytext(streak, i, i + 1)

View File

@@ -11,7 +11,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick)
name = text
src.target = target
if(isdatum(target)) //Harddel man bad
RegisterSignal(target, COMSIG_PARENT_QDELETING, .proc/cleanup)
RegisterSignal(target, COMSIG_PARENT_QDELETING, PROC_REF(cleanup))
/obj/effect/statclick/Destroy()
target = null

View File

@@ -62,7 +62,7 @@
. &= !(protection & CONFIG_ENTRY_HIDDEN)
/datum/config_entry/vv_edit_var(var_name, var_value)
var/static/list/banned_edits = list(NAMEOF(src, name), NAMEOF(src, vv_VAS), NAMEOF(src, default), NAMEOF(src, resident_file), NAMEOF(src, protection), NAMEOF(src, abstract_type), NAMEOF(src, modified), NAMEOF(src, dupes_allowed))
var/static/list/banned_edits = list(NAMEOF_STATIC(src, name), NAMEOF_STATIC(src, vv_VAS), NAMEOF_STATIC(src, default), NAMEOF_STATIC(src, resident_file), NAMEOF_STATIC(src, protection), NAMEOF_STATIC(src, abstract_type), NAMEOF_STATIC(src, modified), NAMEOF_STATIC(src, dupes_allowed))
if(var_name == NAMEOF(src, config_entry_value))
if(protection & CONFIG_ENTRY_LOCKED)
return FALSE
@@ -129,7 +129,7 @@
return FALSE
/datum/config_entry/number/vv_edit_var(var_name, var_value)
var/static/list/banned_edits = list(NAMEOF(src, max_val), NAMEOF(src, min_val), NAMEOF(src, integer))
var/static/list/banned_edits = list(NAMEOF_STATIC(src, max_val), NAMEOF_STATIC(src, min_val), NAMEOF_STATIC(src, integer))
return !(var_name in banned_edits) && ..()
/datum/config_entry/flag

View File

@@ -499,4 +499,4 @@ Example config:
//Message admins when you can.
/datum/controller/configuration/proc/DelayedMessageAdmins(text)
addtimer(CALLBACK(GLOBAL_PROC, /proc/message_admins, text), 0)
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(message_admins), text), 0)

View File

@@ -148,7 +148,7 @@ GLOBAL_REAL(Failsafe, /datum/controller/failsafe)
/proc/recover_all_SS_and_recreate_master()
del(Master)
var/list/subsytem_types = subtypesof(/datum/controller/subsystem)
sortTim(subsytem_types, /proc/cmp_subsystem_init)
sortTim(subsytem_types, GLOBAL_PROC_REF(cmp_subsystem_init))
for(var/I in subsytem_types)
new I
. = Recreate_MC()

View File

@@ -105,7 +105,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
//Code used for first master on game boot or if existing master got deleted
Master = src
var/list/subsystem_types = subtypesof(/datum/controller/subsystem)
sortTim(subsystem_types, /proc/cmp_subsystem_init)
sortTim(subsystem_types, GLOBAL_PROC_REF(cmp_subsystem_init))
//Find any abandoned subsystem from the previous master (if there was any)
var/list/existing_subsystems = list()
@@ -131,7 +131,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
/datum/controller/master/Shutdown()
processing = FALSE
sortTim(subsystems, /proc/cmp_subsystem_init)
sortTim(subsystems, GLOBAL_PROC_REF(cmp_subsystem_init))
reverse_range(subsystems)
for(var/datum/controller/subsystem/ss in subsystems)
log_world("Shutting down [ss.name] subsystem...")
@@ -226,7 +226,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
stage_sorted_subsystems[i] = list()
// Sort subsystems by init_order, so they initialize in the correct order.
sortTim(subsystems, /proc/cmp_subsystem_init)
sortTim(subsystems, GLOBAL_PROC_REF(cmp_subsystem_init))
for (var/datum/controller/subsystem/subsystem as anything in subsystems)
var/subsystem_init_stage = subsystem.init_stage
@@ -236,7 +236,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
stage_sorted_subsystems[subsystem_init_stage] += subsystem
// Sort subsystems by display setting for easy access.
sortTim(subsystems, /proc/cmp_subsystem_display)
sortTim(subsystems, GLOBAL_PROC_REF(cmp_subsystem_display))
var/start_timeofday = REALTIMEOFDAY
for (var/current_init_stage in 1 to INITSTAGE_MAX)
@@ -430,9 +430,9 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
queue_tail = null
//these sort by lower priorities first to reduce the number of loops needed to add subsequent SS's to the queue
//(higher subsystems will be sooner in the queue, adding them later in the loop means we don't have to loop thru them next queue add)
sortTim(tickersubsystems, /proc/cmp_subsystem_priority)
sortTim(tickersubsystems, GLOBAL_PROC_REF(cmp_subsystem_priority))
for(var/I in runlevel_sorted_subsystems)
sortTim(I, /proc/cmp_subsystem_priority)
sortTim(I, GLOBAL_PROC_REF(cmp_subsystem_priority))
I += tickersubsystems
var/cached_runlevel = current_runlevel

View File

@@ -14,7 +14,7 @@ SUBSYSTEM_DEF(augury)
/datum/controller/subsystem/augury/proc/register_doom(atom/A, severity)
doombringers[A] = severity
RegisterSignal(A, COMSIG_PARENT_QDELETING, .proc/unregister_doom)
RegisterSignal(A, COMSIG_PARENT_QDELETING, PROC_REF(unregister_doom))
/datum/controller/subsystem/augury/proc/unregister_doom(atom/A)
SIGNAL_HANDLER

View File

@@ -345,9 +345,9 @@ SUBSYSTEM_DEF(dbcore)
continue
if (warn)
INVOKE_ASYNC(query, /datum/db_query.proc/warn_execute)
INVOKE_ASYNC(query, TYPE_PROC_REF(/datum/db_query, warn_execute))
else
INVOKE_ASYNC(query, /datum/db_query.proc/Execute)
INVOKE_ASYNC(query, TYPE_PROC_REF(/datum/db_query, Execute))
for (var/datum/db_query/query as anything in queries)
query.sync()

View File

@@ -54,7 +54,7 @@ PROCESSING_SUBSYSTEM_DEF(dcs)
fullid += REF(key)
if(length(named_arguments))
named_arguments = sortTim(named_arguments, /proc/cmp_text_asc)
named_arguments = sortTim(named_arguments, GLOBAL_PROC_REF(cmp_text_asc))
fullid += named_arguments
return list2params(fullid)

View File

@@ -37,9 +37,9 @@ SUBSYSTEM_DEF(eigenstates)
for(var/atom/target as anything in targets)
eigen_targets["[id_counter]"] += target
eigen_id[target] = "[id_counter]"
RegisterSignal(target, COMSIG_CLOSET_INSERT, .proc/use_eigenlinked_atom)
RegisterSignal(target, COMSIG_PARENT_QDELETING, .proc/remove_eigen_entry)
RegisterSignal(target, COMSIG_ATOM_TOOL_ACT(TOOL_WELDER), .proc/tool_interact)
RegisterSignal(target, COMSIG_CLOSET_INSERT, PROC_REF(use_eigenlinked_atom))
RegisterSignal(target, COMSIG_PARENT_QDELETING, PROC_REF(remove_eigen_entry))
RegisterSignal(target, COMSIG_ATOM_TOOL_ACT(TOOL_WELDER), PROC_REF(tool_interact))
target.RegisterSignal(target, COMSIG_EIGENSTATE_ACTIVATE, /obj/structure/closet/proc/bust_open)
ADD_TRAIT(target, TRAIT_BANNED_FROM_CARGO_SHUTTLE, REF(src))
var/obj/item = target

View File

@@ -146,7 +146,7 @@ SUBSYSTEM_DEF(explosions)
else
continue
addtimer(CALLBACK(GLOBAL_PROC, .proc/wipe_color_and_text, wipe_colours), 100)
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(wipe_color_and_text), wipe_colours), 100)
/proc/wipe_color_and_text(list/atom/wiping)
for(var/i in wiping)

View File

@@ -153,22 +153,22 @@ SUBSYSTEM_DEF(job)
new_joinable_departments_by_type[department_type] = department
department.add_job(job)
sortTim(new_all_occupations, /proc/cmp_job_display_asc)
sortTim(new_all_occupations, GLOBAL_PROC_REF(cmp_job_display_asc))
for(var/datum/job/job as anything in new_all_occupations)
if(!job.exp_granted_type)
continue
new_experience_jobs_map[job.exp_granted_type] += list(job)
sortTim(new_joinable_departments_by_type, /proc/cmp_department_display_asc, associative = TRUE)
sortTim(new_joinable_departments_by_type, GLOBAL_PROC_REF(cmp_department_display_asc), associative = TRUE)
for(var/department_type in new_joinable_departments_by_type)
var/datum/job_department/department = new_joinable_departments_by_type[department_type]
sortTim(department.department_jobs, /proc/cmp_job_display_asc)
sortTim(department.department_jobs, GLOBAL_PROC_REF(cmp_job_display_asc))
new_joinable_departments += department
if(department.department_experience_type)
new_experience_jobs_map[department.department_experience_type] = department.department_jobs.Copy()
all_occupations = new_all_occupations
joinable_occupations = sortTim(new_joinable_occupations, /proc/cmp_job_display_asc)
joinable_occupations = sortTim(new_joinable_occupations, GLOBAL_PROC_REF(cmp_job_display_asc))
joinable_departments = new_joinable_departments
joinable_departments_by_type = new_joinable_departments_by_type
experience_jobs_map = new_experience_jobs_map
@@ -882,7 +882,7 @@ SUBSYSTEM_DEF(job)
var/oldjobs = SSjob.all_occupations
sleep(2 SECONDS)
for (var/datum/job/job as anything in oldjobs)
INVOKE_ASYNC(src, .proc/RecoverJob, job)
INVOKE_ASYNC(src, PROC_REF(RecoverJob), job)
/datum/controller/subsystem/job/proc/RecoverJob(datum/job/J)
var/datum/job/newjob = GetJob(J.title)

View File

@@ -23,7 +23,7 @@ SUBSYSTEM_DEF(lag_switch)
if(auto_switch_pop)
auto_switch = TRUE
trigger_pop = auto_switch_pop
RegisterSignal(SSdcs, COMSIG_GLOB_CLIENT_CONNECT, .proc/client_connected)
RegisterSignal(SSdcs, COMSIG_GLOB_CLIENT_CONNECT, PROC_REF(client_connected))
return SS_INIT_SUCCESS
/datum/controller/subsystem/lag_switch/proc/client_connected(datum/source, client/connected)
@@ -33,7 +33,7 @@ SUBSYSTEM_DEF(lag_switch)
auto_switch = FALSE
UnregisterSignal(SSdcs, COMSIG_GLOB_CLIENT_CONNECT)
veto_timer_id = addtimer(CALLBACK(src, .proc/set_all_measures, TRUE, TRUE), 20 SECONDS, TIMER_STOPPABLE)
veto_timer_id = addtimer(CALLBACK(src, PROC_REF(set_all_measures), TRUE, TRUE), 20 SECONDS, TIMER_STOPPABLE)
message_admins("Lag Switch population threshold reached. Automatic activation of lag mitigation measures occuring in 20 seconds. (<a href='?_src_=holder;[HrefToken()];change_lag_switch_option=CANCEL'>CANCEL</a>)")
log_admin("Lag Switch population threshold reached. Automatic activation of lag mitigation measures occuring in 20 seconds.")
@@ -41,7 +41,7 @@ SUBSYSTEM_DEF(lag_switch)
/datum/controller/subsystem/lag_switch/proc/toggle_auto_enable()
auto_switch = !auto_switch
if(auto_switch)
RegisterSignal(SSdcs, COMSIG_GLOB_CLIENT_CONNECT, .proc/client_connected)
RegisterSignal(SSdcs, COMSIG_GLOB_CLIENT_CONNECT, PROC_REF(client_connected))
else
UnregisterSignal(SSdcs, COMSIG_GLOB_CLIENT_CONNECT)

View File

@@ -132,4 +132,4 @@ SUBSYSTEM_DEF(lua)
// Update every lua editor TGUI open for each state that had a task awakened or resumed
for(var/datum/lua_state/state in affected_states)
INVOKE_ASYNC(state, /datum/lua_state.proc/update_editors)
INVOKE_ASYNC(state, TYPE_PROC_REF(/datum/lua_state, update_editors))

View File

@@ -261,7 +261,7 @@ SUBSYSTEM_DEF(mapping)
message_admins("Shuttles in transit detected. Attempting to fast travel. Timeout is [wipe_safety_delay/10] seconds.")
var/list/cleared = list()
for(var/i in in_transit)
INVOKE_ASYNC(src, .proc/safety_clear_transit_dock, i, in_transit[i], cleared)
INVOKE_ASYNC(src, PROC_REF(safety_clear_transit_dock), i, in_transit[i], cleared)
UNTIL((go_ahead < world.time) || (cleared.len == in_transit.len))
do_wipe_turf_reservations()
clearing_reserved_turfs = FALSE
@@ -542,7 +542,7 @@ GLOBAL_LIST_EMPTY(the_station_areas)
banned += generateMapList("spaceruinblacklist.txt")
banned += generateMapList("iceruinblacklist.txt")
for(var/item in sort_list(subtypesof(/datum/map_template/ruin), /proc/cmp_ruincost_priority))
for(var/item in sort_list(subtypesof(/datum/map_template/ruin), GLOBAL_PROC_REF(cmp_ruincost_priority)))
var/datum/map_template/ruin/ruin_type = item
// screen out the abstract subtypes
if(!initial(ruin_type.id))

View File

@@ -155,7 +155,7 @@ SUBSYSTEM_DEF(materials)
for(var/x in materials_declaration)
var/datum/material/mat = x
combo_params += "[istype(mat) ? mat.id : mat]=[materials_declaration[mat] * multiplier]"
sortTim(combo_params, /proc/cmp_text_asc) // We have to sort now in case the declaration was not in order
sortTim(combo_params, GLOBAL_PROC_REF(cmp_text_asc)) // We have to sort now in case the declaration was not in order
var/combo_index = combo_params.Join("-")
var/list/combo = material_combos[combo_index]
if(!combo)

View File

@@ -31,7 +31,7 @@
src.controller = controller
src.extra_info = extra_info
if(extra_info)
RegisterSignal(extra_info, COMSIG_PARENT_QDELETING, .proc/info_deleted)
RegisterSignal(extra_info, COMSIG_PARENT_QDELETING, PROC_REF(info_deleted))
src.moving = moving
src.priority = priority
src.flags = flags
@@ -240,7 +240,7 @@
target = chasing
if(!isturf(target))
RegisterSignal(target, COMSIG_PARENT_QDELETING, .proc/handle_no_target) //Don't do this for turfs, because we don't care
RegisterSignal(target, COMSIG_PARENT_QDELETING, PROC_REF(handle_no_target)) //Don't do this for turfs, because we don't care
/datum/move_loop/has_target/compare_loops(datum/move_loop/loop_type, priority, flags, extra_info, delay, timeout, atom/chasing)
if(..() && chasing == target)
@@ -369,7 +369,7 @@
src.avoid = avoid
src.skip_first = skip_first
if(isidcard(id))
RegisterSignal(id, COMSIG_PARENT_QDELETING, .proc/handle_no_id) //I prefer erroring to harddels. If this breaks anything consider making id info into a datum or something
RegisterSignal(id, COMSIG_PARENT_QDELETING, PROC_REF(handle_no_id)) //I prefer erroring to harddels. If this breaks anything consider making id info into a datum or something
/datum/move_loop/has_target/jps/compare_loops(datum/move_loop/loop_type, priority, flags, extra_info, delay, timeout, atom/chasing, repath_delay, max_path_length, minimum_distance, obj/item/card/id/id, simulated_only, turf/avoid, skip_first)
if(..() && repath_delay == src.repath_delay && max_path_length == src.max_path_length && minimum_distance == src.minimum_distance && id == src.id && simulated_only == src.simulated_only && avoid == src.avoid)
@@ -378,7 +378,7 @@
/datum/move_loop/has_target/jps/start_loop()
. = ..()
INVOKE_ASYNC(src, .proc/recalculate_path)
INVOKE_ASYNC(src, PROC_REF(recalculate_path))
/datum/move_loop/has_target/jps/Destroy()
id = null //Kill me
@@ -399,7 +399,7 @@
/datum/move_loop/has_target/jps/move()
if(!length(movement_path))
INVOKE_ASYNC(src, .proc/recalculate_path)
INVOKE_ASYNC(src, PROC_REF(recalculate_path))
if(!length(movement_path))
return FALSE
@@ -413,7 +413,7 @@
if(get_turf(moving) == next_step)
movement_path.Cut(1,2)
else
INVOKE_ASYNC(src, .proc/recalculate_path)
INVOKE_ASYNC(src, PROC_REF(recalculate_path))
return FALSE
@@ -572,8 +572,8 @@
if(home)
if(ismovable(target))
RegisterSignal(target, COMSIG_MOVABLE_MOVED, .proc/update_slope) //If it can move, update your slope when it does
RegisterSignal(moving, COMSIG_MOVABLE_MOVED, .proc/handle_move)
RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(update_slope)) //If it can move, update your slope when it does
RegisterSignal(moving, COMSIG_MOVABLE_MOVED, PROC_REF(handle_move))
update_slope()
/datum/move_loop/has_target/move_towards/compare_loops(datum/move_loop/loop_type, priority, flags, extra_info, delay, timeout, atom/chasing, home = FALSE)

View File

@@ -29,7 +29,7 @@ SUBSYSTEM_DEF(pathfinder)
while(flow[free])
CHECK_TICK
free = (free % lcount) + 1
var/t = addtimer(CALLBACK(src, /datum/flowcache.proc/toolong, free), 150, TIMER_STOPPABLE)
var/t = addtimer(CALLBACK(src, TYPE_PROC_REF(/datum/flowcache, toolong), free), 150, TIMER_STOPPABLE)
flow[free] = t
flow[t] = M
return free

View File

@@ -221,7 +221,7 @@ SUBSYSTEM_DEF(points_of_interest)
else
return sort_difference
/// Priority list broadly stolen from /proc/sortmobs. Lower numbers are higher priorities when sorted and appear closer to the top or start of lists.
/// Priority list broadly stolen from /proc/sortmobs(). Lower numbers are higher priorities when sorted and appear closer to the top or start of lists.
/datum/point_of_interest/mob_poi/proc/get_type_sort_priority()
if(isAI(target))
return 0

View File

@@ -51,7 +51,7 @@ PROCESSING_SUBSYSTEM_DEF(quirks)
/datum/controller/subsystem/processing/quirks/proc/SetupQuirks()
// Sort by Positive, Negative, Neutral; and then by name
var/list/quirk_list = sort_list(subtypesof(/datum/quirk), /proc/cmp_quirk_asc)
var/list/quirk_list = sort_list(subtypesof(/datum/quirk), GLOBAL_PROC_REF(cmp_quirk_asc))
for(var/type in quirk_list)
var/datum/quirk/quirk_type = type

View File

@@ -244,10 +244,10 @@ SUBSYSTEM_DEF(shuttle)
/datum/controller/subsystem/shuttle/proc/block_recall(lockout_timer)
if(admin_emergency_no_recall)
priority_announce("Error!", "Emergency Shuttle Uplink Alert", 'sound/misc/announce_dig.ogg')
addtimer(CALLBACK(src, .proc/unblock_recall), lockout_timer)
addtimer(CALLBACK(src, PROC_REF(unblock_recall)), lockout_timer)
return
emergency_no_recall = TRUE
addtimer(CALLBACK(src, .proc/unblock_recall), lockout_timer)
addtimer(CALLBACK(src, PROC_REF(unblock_recall)), lockout_timer)
/datum/controller/subsystem/shuttle/proc/unblock_recall()
if(admin_emergency_no_recall)

View File

@@ -125,13 +125,13 @@ SUBSYSTEM_DEF(spatial_grid)
pregenerate_more_oranges_ears(NUMBER_OF_PREGENERATED_ORANGES_EARS)
RegisterSignal(SSdcs, COMSIG_GLOB_NEW_Z, .proc/propogate_spatial_grid_to_new_z)
RegisterSignal(SSdcs, COMSIG_GLOB_EXPANDED_WORLD_BOUNDS, .proc/after_world_bounds_expanded)
RegisterSignal(SSdcs, COMSIG_GLOB_NEW_Z, PROC_REF(propogate_spatial_grid_to_new_z))
RegisterSignal(SSdcs, COMSIG_GLOB_EXPANDED_WORLD_BOUNDS, PROC_REF(after_world_bounds_expanded))
return SS_INIT_SUCCESS
///add a movable to the pre init queue for whichever type is specified so that when the subsystem initializes they get added to the grid
/datum/controller/subsystem/spatial_grid/proc/enter_pre_init_queue(atom/movable/waiting_movable, type)
RegisterSignal(waiting_movable, COMSIG_PARENT_QDELETING, .proc/queued_item_deleted, override = TRUE)
RegisterSignal(waiting_movable, COMSIG_PARENT_QDELETING, PROC_REF(queued_item_deleted), override = TRUE)
//override because something can enter the queue for two different types but that is done through unrelated procs that shouldnt know about eachother
waiting_to_add_by_type[type] += waiting_movable

View File

@@ -382,8 +382,8 @@ SUBSYSTEM_DEF(statpanels)
if(actively_tracking)
stop_turf_tracking()
var/static/list/connections = list(
COMSIG_MOVABLE_MOVED = .proc/on_mob_move,
COMSIG_MOB_LOGOUT = .proc/on_mob_logout,
COMSIG_MOVABLE_MOVED = PROC_REF(on_mob_move),
COMSIG_MOB_LOGOUT = PROC_REF(on_mob_logout),
)
AddComponent(/datum/component/connect_mob_behalf, parent, connections)
actively_tracking = TRUE

View File

@@ -180,7 +180,7 @@ SUBSYSTEM_DEF(trading_card_game)
totalCards++
cardsByCount[id] += 1
var/toSend = "Out of [totalCards] cards"
for(var/id in sort_list(cardsByCount, /proc/cmp_num_string_asc))
for(var/id in sort_list(cardsByCount, GLOBAL_PROC_REF(cmp_num_string_asc)))
if(id)
var/datum/card/template = cached_cards[pack.series]["ALL"][id]
toSend += "\nID:[id] [template.name] [(cardsByCount[id] * 100) / totalCards]% Total:[cardsByCount[id]]"

View File

@@ -94,7 +94,7 @@ SUBSYSTEM_DEF(throwing)
/datum/thrownthing/New(thrownthing, target, init_dir, maxrange, speed, thrower, diagonals_first, force, gentle, callback, target_zone)
. = ..()
src.thrownthing = thrownthing
RegisterSignal(thrownthing, COMSIG_PARENT_QDELETING, .proc/on_thrownthing_qdel)
RegisterSignal(thrownthing, COMSIG_PARENT_QDELETING, PROC_REF(on_thrownthing_qdel))
src.starting_turf = get_turf(thrownthing)
src.target_turf = get_turf(target)
if(target_turf != target)

View File

@@ -161,7 +161,7 @@ SUBSYSTEM_DEF(ticker)
send2chat("<@&[CONFIG_GET(string/game_alert_role_id)]> New round starting on [SSmapping.config.map_name], [CONFIG_GET(string/servername)]! \nIf you wish to be pinged for game related stuff, go to <#[CONFIG_GET(string/role_assign_channel_id)]> and assign yourself the roles.", CONFIG_GET(string/chat_announce_new_game)) // Skyrat EDIT -- role pingcurrent_state = GAME_STATE_PREGAME
current_state = GAME_STATE_PREGAME
SStitle.change_title_screen() //SKYRAT EDIT ADDITION - Title screen
addtimer(CALLBACK(SStitle, /datum/controller/subsystem/title/.proc/change_title_screen), 1 SECONDS) //SKYRAT EDIT ADDITION - Title screen
addtimer(CALLBACK(SStitle, TYPE_PROC_REF(/datum/controller/subsystem/title, change_title_screen)), 1 SECONDS) //SKYRAT EDIT ADDITION - Title screen
//Everyone who wants to be an observer is now spawned
SEND_SIGNAL(src, COMSIG_TICKER_ENTER_PREGAME)
fire()
@@ -424,7 +424,7 @@ SUBSYSTEM_DEF(ticker)
captainless = FALSE
var/acting_captain = !is_captain_job(player_assigned_role)
SSjob.promote_to_captain(new_player_living, acting_captain)
OnRoundstart(CALLBACK(GLOBAL_PROC, .proc/minor_announce, player_assigned_role.get_captaincy_announcement(new_player_living)))
OnRoundstart(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(minor_announce), player_assigned_role.get_captaincy_announcement(new_player_living)))
if((player_assigned_role.job_flags & JOB_ASSIGN_QUIRKS) && ishuman(new_player_living) && CONFIG_GET(flag/roundstart_traits))
if(new_player_mob.client?.prefs?.should_be_random_hardcore(player_assigned_role, new_player_living.mind))
new_player_mob.client.prefs.hardcore_random_setup(new_player_living)
@@ -486,7 +486,7 @@ SUBSYSTEM_DEF(ticker)
living.client.init_verbs()
livings += living
if(livings.len)
addtimer(CALLBACK(src, .proc/release_characters, livings), 30, TIMER_CLIENT_TIME)
addtimer(CALLBACK(src, PROC_REF(release_characters), livings), 30, TIMER_CLIENT_TIME)
/datum/controller/subsystem/ticker/proc/release_characters(list/livings)
for(var/I in livings)
@@ -531,7 +531,7 @@ SUBSYSTEM_DEF(ticker)
return
if(world.time - SSticker.round_start_time < 10 MINUTES) //Not forcing map rotation for very short rounds.
return
INVOKE_ASYNC(SSmapping, /datum/controller/subsystem/mapping/.proc/maprotate)
INVOKE_ASYNC(SSmapping, TYPE_PROC_REF(/datum/controller/subsystem/mapping/, maprotate))
/datum/controller/subsystem/ticker/proc/HasRoundStarted()
return current_state >= GAME_STATE_PLAYING

View File

@@ -101,7 +101,13 @@ SUBSYSTEM_DEF(time_track)
last_tick_tickcount = current_tickcount
var/sendmaps_json = world.Profile(PROFILE_REFRESH, type = "sendmaps", format="json")
var/list/send_maps_data = json_decode(sendmaps_json)
var/list/send_maps_data = null
try
send_maps_data = json_decode(sendmaps_json)
catch
text2file(sendmaps_json,"bad_sendmaps.json")
can_fire = FALSE
return
var/send_maps_sort = send_maps_data.Copy() //Doing it like this guarentees us a properly sorted list
for(var/list/packet in send_maps_data)

View File

@@ -277,7 +277,7 @@ SUBSYSTEM_DEF(timer)
return
// Sort all timers by time to run
sortTim(alltimers, .proc/cmp_timer)
sortTim(alltimers, GLOBAL_PROC_REF(cmp_timer))
// Get the earliest timer, and if the TTR is earlier than the current world.time,
// then set the head offset appropriately to be the earliest time tracked by the

View File

@@ -89,7 +89,7 @@ SUBSYSTEM_DEF(traitor)
uplink_handlers |= uplink_handler
// An uplink handler can be registered multiple times if they get assigned to new uplinks, so
// override is set to TRUE here because it is intentional that they could get added multiple times.
RegisterSignal(uplink_handler, COMSIG_PARENT_QDELETING, .proc/uplink_handler_deleted, override = TRUE)
RegisterSignal(uplink_handler, COMSIG_PARENT_QDELETING, PROC_REF(uplink_handler_deleted), override = TRUE)
/datum/controller/subsystem/traitor/proc/uplink_handler_deleted(datum/uplink_handler/uplink_handler)
SIGNAL_HANDLER

View File

@@ -81,7 +81,7 @@ SUBSYSTEM_DEF(verb_manager)
#ifdef UNIT_TESTS
if(QDELETED(usr) && ismob(incoming_callback.object))
incoming_callback.user = WEAKREF(incoming_callback.object)
var/datum/callback/new_us = CALLBACK(arglist(list(GLOBAL_PROC, /proc/_queue_verb) + args.Copy()))
var/datum/callback/new_us = CALLBACK(arglist(list(GLOBAL_PROC, GLOBAL_PROC_REF(_queue_verb)) + args.Copy()))
return world.push_usr(incoming_callback.object, new_us)
#endif

View File

@@ -30,7 +30,7 @@ SUBSYSTEM_DEF(weather)
run_weather(our_event, list(text2num(z)))
eligible_zlevels -= z
var/randTime = rand(3000, 6000)
next_hit_by_zlevel["[z]"] = addtimer(CALLBACK(src, .proc/make_eligible, z, possible_weather), randTime + initial(our_event.weather_duration_upper), TIMER_UNIQUE|TIMER_STOPPABLE) //Around 5-10 minutes between weathers
next_hit_by_zlevel["[z]"] = addtimer(CALLBACK(src, PROC_REF(make_eligible), z, possible_weather), randTime + initial(our_event.weather_duration_upper), TIMER_UNIQUE|TIMER_STOPPABLE) //Around 5-10 minutes between weathers
/datum/controller/subsystem/weather/Initialize()
for(var/V in subtypesof(/datum/weather))

View File

@@ -42,13 +42,13 @@
/// Links the passed target to our action, registering any relevant signals
/datum/action/proc/link_to(Target)
target = Target
RegisterSignal(target, COMSIG_PARENT_QDELETING, .proc/clear_ref, override = TRUE)
RegisterSignal(target, COMSIG_PARENT_QDELETING, PROC_REF(clear_ref), override = TRUE)
if(isatom(target))
RegisterSignal(target, COMSIG_ATOM_UPDATED_ICON, .proc/update_icon_on_signal)
RegisterSignal(target, COMSIG_ATOM_UPDATED_ICON, PROC_REF(update_icon_on_signal))
if(istype(target, /datum/mind))
RegisterSignal(target, COMSIG_MIND_TRANSFERRED, .proc/on_target_mind_swapped)
RegisterSignal(target, COMSIG_MIND_TRANSFERRED, PROC_REF(on_target_mind_swapped))
/datum/action/Destroy()
if(owner)
@@ -77,18 +77,18 @@
Remove(owner)
SEND_SIGNAL(src, COMSIG_ACTION_GRANTED, grant_to)
owner = grant_to
RegisterSignal(owner, COMSIG_PARENT_QDELETING, .proc/clear_ref, override = TRUE)
RegisterSignal(owner, COMSIG_PARENT_QDELETING, PROC_REF(clear_ref), override = TRUE)
// Register some signals based on our check_flags
// so that our button icon updates when relevant
if(check_flags & AB_CHECK_CONSCIOUS)
RegisterSignal(owner, COMSIG_MOB_STATCHANGE, .proc/update_icon_on_signal)
RegisterSignal(owner, COMSIG_MOB_STATCHANGE, PROC_REF(update_icon_on_signal))
if(check_flags & AB_CHECK_IMMOBILE)
RegisterSignal(owner, SIGNAL_ADDTRAIT(TRAIT_IMMOBILIZED), .proc/update_icon_on_signal)
RegisterSignal(owner, SIGNAL_ADDTRAIT(TRAIT_IMMOBILIZED), PROC_REF(update_icon_on_signal))
if(check_flags & AB_CHECK_HANDS_BLOCKED)
RegisterSignal(owner, SIGNAL_ADDTRAIT(TRAIT_HANDS_BLOCKED), .proc/update_icon_on_signal)
RegisterSignal(owner, SIGNAL_ADDTRAIT(TRAIT_HANDS_BLOCKED), PROC_REF(update_icon_on_signal))
if(check_flags & AB_CHECK_LYING)
RegisterSignal(owner, COMSIG_LIVING_SET_BODY_POSITION, .proc/update_icon_on_signal)
RegisterSignal(owner, COMSIG_LIVING_SET_BODY_POSITION, PROC_REF(update_icon_on_signal))
if(owner_has_control)
GiveAction(grant_to)
@@ -117,7 +117,7 @@
))
if(target == owner)
RegisterSignal(target, COMSIG_PARENT_QDELETING, .proc/clear_ref)
RegisterSignal(target, COMSIG_PARENT_QDELETING, PROC_REF(clear_ref))
owner = null
/// Actually triggers the effects of the action.

View File

@@ -59,7 +59,7 @@
UpdateButtons()
if(next_use_time > world.time)
START_PROCESSING(SSfastprocess, src)
RegisterSignal(granted_to, COMSIG_HOSTILE_PRE_ATTACKINGTARGET, .proc/handle_melee_attack)
RegisterSignal(granted_to, COMSIG_HOSTILE_PRE_ATTACKINGTARGET, PROC_REF(handle_melee_attack))
for(var/datum/action/cooldown/ability as anything in initialized_actions)
ability.Grant(granted_to)
@@ -192,7 +192,7 @@
for(var/datum/action/cooldown/ability as anything in initialized_actions)
if(LAZYLEN(ability.initialized_actions) > 0)
ability.initialized_actions = list()
addtimer(CALLBACK(ability, .proc/Activate, target), total_delay)
addtimer(CALLBACK(ability, PROC_REF(Activate), target), total_delay)
total_delay += initialized_actions[ability]
StartCooldown()

View File

@@ -34,7 +34,7 @@
/datum/action/item_action/agent_box/Grant(mob/grant_to)
. = ..()
if(owner)
RegisterSignal(owner, COMSIG_HUMAN_SUICIDE_ACT, .proc/suicide_act)
RegisterSignal(owner, COMSIG_HUMAN_SUICIDE_ACT, PROC_REF(suicide_act))
/datum/action/item_action/agent_box/Remove(mob/M)
if(owner)

View File

@@ -48,9 +48,9 @@
charging += charger
actively_moving = FALSE
SEND_SIGNAL(owner, COMSIG_STARTED_CHARGE)
RegisterSignal(charger, COMSIG_MOVABLE_BUMP, .proc/on_bump, TRUE)
RegisterSignal(charger, COMSIG_MOVABLE_PRE_MOVE, .proc/on_move, TRUE)
RegisterSignal(charger, COMSIG_MOVABLE_MOVED, .proc/on_moved, TRUE)
RegisterSignal(charger, COMSIG_MOVABLE_BUMP, PROC_REF(on_bump), TRUE)
RegisterSignal(charger, COMSIG_MOVABLE_PRE_MOVE, PROC_REF(on_move), TRUE)
RegisterSignal(charger, COMSIG_MOVABLE_MOVED, PROC_REF(on_moved), TRUE)
DestroySurroundings(charger)
charger.setDir(dir)
do_charge_indicator(charger, target)
@@ -62,11 +62,11 @@
var/datum/move_loop/new_loop = SSmove_manager.home_onto(charger, target, delay = charge_speed, timeout = time_to_hit, priority = MOVEMENT_ABOVE_SPACE_PRIORITY)
if(!new_loop)
return
RegisterSignal(new_loop, COMSIG_MOVELOOP_PREPROCESS_CHECK, .proc/pre_move)
RegisterSignal(new_loop, COMSIG_MOVELOOP_POSTPROCESS, .proc/post_move)
RegisterSignal(new_loop, COMSIG_PARENT_QDELETING, .proc/charge_end)
RegisterSignal(new_loop, COMSIG_MOVELOOP_PREPROCESS_CHECK, PROC_REF(pre_move))
RegisterSignal(new_loop, COMSIG_MOVELOOP_POSTPROCESS, PROC_REF(post_move))
RegisterSignal(new_loop, COMSIG_PARENT_QDELETING, PROC_REF(charge_end))
if(ismob(charger))
RegisterSignal(charger, COMSIG_MOB_STATCHANGE, .proc/stat_changed)
RegisterSignal(charger, COMSIG_MOB_STATCHANGE, PROC_REF(stat_changed))
// Yes this is disgusting. But we need to queue this stuff, and this code just isn't setup to support that right now. So gotta do it with sleeps
sleep(time_to_hit + charge_speed)
@@ -109,12 +109,12 @@
if(!actively_moving)
return COMPONENT_MOVABLE_BLOCK_PRE_MOVE
new /obj/effect/temp_visual/decoy/fading(source.loc, source)
INVOKE_ASYNC(src, .proc/DestroySurroundings, source)
INVOKE_ASYNC(src, PROC_REF(DestroySurroundings), source)
/datum/action/cooldown/mob_cooldown/charge/proc/on_moved(atom/source)
SIGNAL_HANDLER
playsound(source, 'sound/effects/meteorimpact.ogg', 200, TRUE, 2, TRUE)
INVOKE_ASYNC(src, .proc/DestroySurroundings, source)
INVOKE_ASYNC(src, PROC_REF(DestroySurroundings), source)
/datum/action/cooldown/mob_cooldown/charge/proc/DestroySurroundings(atom/movable/charger)
if(!destroy_objects)
@@ -154,7 +154,7 @@
if(isobj(target) && target.density)
SSexplosions.med_mov_atom += target
INVOKE_ASYNC(src, .proc/DestroySurroundings, source)
INVOKE_ASYNC(src, PROC_REF(DestroySurroundings), source)
hit_target(source, target, charge_damage)
/datum/action/cooldown/mob_cooldown/charge/proc/hit_target(atom/movable/source, atom/target, damage_dealt)
@@ -261,7 +261,7 @@
our_clone.alpha = 127.5
our_clone.move_through_mob = owner
our_clone.spawn_blood = spawn_blood
INVOKE_ASYNC(src, .proc/do_charge, our_clone, target_atom, delay, past)
INVOKE_ASYNC(src, PROC_REF(do_charge), our_clone, target_atom, delay, past)
if(use_self)
do_charge(owner, target_atom, delay, past)

View File

@@ -41,7 +41,7 @@
/datum/action/cooldown/mob_cooldown/fire_breath/cone/attack_sequence(atom/target)
playsound(owner.loc, fire_sound, 200, TRUE)
for(var/offset in angles)
INVOKE_ASYNC(src, .proc/fire_line, target, offset)
INVOKE_ASYNC(src, PROC_REF(fire_line), target, offset)
/datum/action/cooldown/mob_cooldown/fire_breath/mass_fire
name = "Mass Fire"
@@ -59,5 +59,5 @@
playsound(owner.loc, fire_sound, 200, TRUE)
var/increment = 360 / spiral_count
for(var/j = 1 to spiral_count)
INVOKE_ASYNC(src, .proc/fire_line, target, j * increment + i * increment / 2)
INVOKE_ASYNC(src, PROC_REF(fire_line), target, j * increment + i * increment / 2)
SLEEP_CHECK_DEATH(delay_time, owner)

View File

@@ -32,7 +32,7 @@
if(enraged)
swoop_attack(target, TRUE)
return
INVOKE_ASYNC(src, .proc/lava_pools, target)
INVOKE_ASYNC(src, PROC_REF(lava_pools), target)
swoop_attack(target)
/datum/action/cooldown/mob_cooldown/lava_swoop/proc/swoop_attack(atom/target, lava_arena = FALSE)
@@ -213,7 +213,7 @@
/obj/effect/temp_visual/dragon_flight/Initialize(mapload, negative)
. = ..()
INVOKE_ASYNC(src, .proc/flight, negative)
INVOKE_ASYNC(src, PROC_REF(flight), negative)
/obj/effect/temp_visual/dragon_flight/proc/flight(negative)
if(negative)

View File

@@ -93,7 +93,7 @@
/datum/action/cooldown/mob_cooldown/projectile_attack/rapid_fire/shrapnel/attack_sequence(mob/living/firer, atom/target)
for(var/i in 1 to shot_count)
var/obj/projectile/to_explode = shoot_projectile(firer, target, null, firer, rand(-default_projectile_spread, default_projectile_spread), null)
addtimer(CALLBACK(src, .proc/explode_into_shrapnel, firer, target, to_explode), break_time)
addtimer(CALLBACK(src, PROC_REF(explode_into_shrapnel), firer, target, to_explode), break_time)
SLEEP_CHECK_DEATH(shot_delay, src)
/datum/action/cooldown/mob_cooldown/projectile_attack/rapid_fire/shrapnel/proc/explode_into_shrapnel(mob/living/firer, atom/target, obj/projectile/to_explode)
@@ -123,7 +123,7 @@
/datum/action/cooldown/mob_cooldown/projectile_attack/spiral_shots/attack_sequence(mob/living/firer, atom/target)
if(enraged)
SLEEP_CHECK_DEATH(1 SECONDS, firer)
INVOKE_ASYNC(src, .proc/create_spiral_attack, firer, target, TRUE)
INVOKE_ASYNC(src, PROC_REF(create_spiral_attack), firer, target, TRUE)
create_spiral_attack(firer, target, FALSE)
return
create_spiral_attack(firer, target)

View File

@@ -104,7 +104,7 @@ multiple modular subtrees with behaviors
else
set_ai_status(AI_STATUS_ON)
RegisterSignal(pawn, COMSIG_MOB_LOGIN, .proc/on_sentience_gained)
RegisterSignal(pawn, COMSIG_MOB_LOGIN, PROC_REF(on_sentience_gained))
///Abstract proc for initializing the pawn to the new controller
/datum/ai_controller/proc/TryPossessPawn(atom/new_pawn)
@@ -254,13 +254,13 @@ multiple modular subtrees with behaviors
UnregisterSignal(pawn, COMSIG_MOB_LOGIN)
if(!continue_processing_when_client)
set_ai_status(AI_STATUS_OFF) //Can't do anything while player is connected
RegisterSignal(pawn, COMSIG_MOB_LOGOUT, .proc/on_sentience_lost)
RegisterSignal(pawn, COMSIG_MOB_LOGOUT, PROC_REF(on_sentience_lost))
/datum/ai_controller/proc/on_sentience_lost()
SIGNAL_HANDLER
UnregisterSignal(pawn, COMSIG_MOB_LOGOUT)
set_ai_status(AI_STATUS_ON) //Can't do anything while player is connected
RegisterSignal(pawn, COMSIG_MOB_LOGIN, .proc/on_sentience_gained)
RegisterSignal(pawn, COMSIG_MOB_LOGIN, PROC_REF(on_sentience_gained))
/// Use this proc to define how your controller defines what access the pawn has for the sake of pathfinding, likely pointing to whatever ID slot is relevant
/datum/ai_controller/proc/get_access()

View File

@@ -8,7 +8,7 @@
update_speed(basic_mob)
RegisterSignal(basic_mob, POST_BASIC_MOB_UPDATE_VARSPEED, .proc/update_speed)
RegisterSignal(basic_mob, POST_BASIC_MOB_UPDATE_VARSPEED, PROC_REF(update_speed))
return ..() //Run parent at end

View File

@@ -18,8 +18,8 @@
/datum/ai_controller/cursed/TryPossessPawn(atom/new_pawn)
if(!isitem(new_pawn))
return AI_CONTROLLER_INCOMPATIBLE
RegisterSignal(new_pawn, COMSIG_MOVABLE_IMPACT, .proc/on_throw_hit)
RegisterSignal(new_pawn, COMSIG_ITEM_EQUIPPED, .proc/on_equip)
RegisterSignal(new_pawn, COMSIG_MOVABLE_IMPACT, PROC_REF(on_throw_hit))
RegisterSignal(new_pawn, COMSIG_ITEM_EQUIPPED, PROC_REF(on_equip))
return ..() //Run parent at end
/datum/ai_controller/cursed/UnpossessPawn()
@@ -32,12 +32,12 @@
if(!iscarbon(hit_atom))
return
//equipcode has sleeps all over it.
INVOKE_ASYNC(src, .proc/try_equipping_to_target_slot, hit_atom)
INVOKE_ASYNC(src, PROC_REF(try_equipping_to_target_slot), hit_atom)
///signal called by picking up the pawn, will try to equip to where it should actually be and start the curse
/datum/ai_controller/cursed/proc/on_equip(datum/source, mob/equipper, slot)
SIGNAL_HANDLER
INVOKE_ASYNC(src, .proc/try_equipping_to_target_slot, equipper, slot)
INVOKE_ASYNC(src, PROC_REF(try_equipping_to_target_slot), equipper, slot)
/**
* curse of hunger component; for very hungry items.

View File

@@ -27,11 +27,11 @@
if(!isliving(new_pawn))
return AI_CONTROLLER_INCOMPATIBLE
RegisterSignal(new_pawn, COMSIG_ATOM_ATTACK_HAND, .proc/on_attack_hand)
RegisterSignal(new_pawn, COMSIG_PARENT_EXAMINE, .proc/on_examined)
RegisterSignal(new_pawn, COMSIG_CLICK_ALT, .proc/check_altclicked)
RegisterSignal(new_pawn, list(COMSIG_LIVING_DEATH, COMSIG_PARENT_QDELETING), .proc/on_death)
RegisterSignal(SSdcs, COMSIG_GLOB_CARBON_THROW_THING, .proc/listened_throw)
RegisterSignal(new_pawn, COMSIG_ATOM_ATTACK_HAND, PROC_REF(on_attack_hand))
RegisterSignal(new_pawn, COMSIG_PARENT_EXAMINE, PROC_REF(on_examined))
RegisterSignal(new_pawn, COMSIG_CLICK_ALT, PROC_REF(check_altclicked))
RegisterSignal(new_pawn, list(COMSIG_LIVING_DEATH, COMSIG_PARENT_QDELETING), PROC_REF(on_death))
RegisterSignal(SSdcs, COMSIG_GLOB_CARBON_THROW_THING, PROC_REF(listened_throw))
return ..() //Run parent at end
/datum/ai_controller/dog/UnpossessPawn(destroy)
@@ -73,7 +73,7 @@
if(blackboard[BB_FETCH_IGNORE_LIST][WEAKREF(thrown_thing)])
return
RegisterSignal(thrown_thing, COMSIG_MOVABLE_THROW_LANDED, .proc/listen_throw_land)
RegisterSignal(thrown_thing, COMSIG_MOVABLE_THROW_LANDED, PROC_REF(listen_throw_land))
/// A throw we were listening to has finished, see if it's in range for us to try grabbing it
/datum/ai_controller/dog/proc/listen_throw_land(obj/item/thrown_thing, datum/thrownthing/throwing_datum)
@@ -125,8 +125,8 @@
if(in_range(pawn, new_friend))
new_friend.visible_message("<b>[pawn]</b> licks at [new_friend] in a friendly manner!", span_notice("[pawn] licks at you in a friendly manner!"))
friends[friend_ref] = TRUE
RegisterSignal(new_friend, COMSIG_MOB_POINTED, .proc/check_point)
RegisterSignal(new_friend, COMSIG_MOB_SAY, .proc/check_verbal_command)
RegisterSignal(new_friend, COMSIG_MOB_POINTED, PROC_REF(check_point))
RegisterSignal(new_friend, COMSIG_MOB_SAY, PROC_REF(check_verbal_command))
/// Someone is being mean to us, take them off our friends (add actual enemies behavior later)
/datum/ai_controller/dog/proc/unfriend(mob/living/ex_friend)
@@ -169,7 +169,7 @@
if(!istype(clicker) || !blackboard[BB_DOG_FRIENDS][WEAKREF(clicker)])
return
. = COMPONENT_CANCEL_CLICK_ALT
INVOKE_ASYNC(src, .proc/command_radial, clicker)
INVOKE_ASYNC(src, PROC_REF(command_radial), clicker)
/// Show the command radial menu
/datum/ai_controller/dog/proc/command_radial(mob/living/clicker)
@@ -180,7 +180,7 @@
COMMAND_DIE = image(icon = 'icons/mob/simple/pets.dmi', icon_state = "puppy_dead")
)
var/choice = show_radial_menu(clicker, pawn, commands, custom_check = CALLBACK(src, .proc/check_menu, clicker), tooltips = TRUE)
var/choice = show_radial_menu(clicker, pawn, commands, custom_check = CALLBACK(src, PROC_REF(check_menu), clicker), tooltips = TRUE)
if(!choice || !check_menu(clicker))
return
set_command_mode(clicker, choice)

View File

@@ -12,7 +12,7 @@
/datum/ai_behavior/battle_screech/perform(delta_time, datum/ai_controller/controller)
. = ..()
var/mob/living/living_pawn = controller.pawn
INVOKE_ASYNC(living_pawn, /mob.proc/emote, pick(screeches))
INVOKE_ASYNC(living_pawn, TYPE_PROC_REF(/mob, emote), pick(screeches))
finish_action(controller, TRUE)
///Moves to target then finishes

View File

@@ -13,7 +13,7 @@
/datum/ai_controller/haunted/TryPossessPawn(atom/new_pawn)
if(!isitem(new_pawn))
return AI_CONTROLLER_INCOMPATIBLE
RegisterSignal(new_pawn, COMSIG_ITEM_EQUIPPED, .proc/on_equip)
RegisterSignal(new_pawn, COMSIG_ITEM_EQUIPPED, PROC_REF(on_equip))
return ..() //Run parent at end
/datum/ai_controller/haunted/UnpossessPawn()
@@ -36,12 +36,12 @@
else
blackboard[BB_LIKES_EQUIPPER] = TRUE
RegisterSignal(pawn, COMSIG_ITEM_DROPPED, .proc/on_dropped)
RegisterSignal(pawn, COMSIG_ITEM_DROPPED, PROC_REF(on_dropped))
///Flip it so we listen for equip again but not for drop.
/datum/ai_controller/haunted/proc/on_dropped(datum/source, mob/user)
SIGNAL_HANDLER
RegisterSignal(pawn, COMSIG_ITEM_EQUIPPED, .proc/on_equip)
RegisterSignal(pawn, COMSIG_ITEM_EQUIPPED, PROC_REF(on_equip))
blackboard[BB_LIKES_EQUIPPER] = FALSE
UnregisterSignal(pawn, COMSIG_ITEM_DROPPED)

View File

@@ -19,9 +19,9 @@
var/move_dir = pick(GLOB.alldirs)
living_pawn.Move(get_step(living_pawn, move_dir), move_dir)
else if(DT_PROB(5, delta_time))
INVOKE_ASYNC(living_pawn, /mob.proc/emote, pick(common_emotes))
INVOKE_ASYNC(living_pawn, TYPE_PROC_REF(/mob, emote), pick(common_emotes))
else if(DT_PROB(1, delta_time))
INVOKE_ASYNC(living_pawn, /mob.proc/emote, pick(rare_emotes))
INVOKE_ASYNC(living_pawn, TYPE_PROC_REF(/mob, emote), pick(rare_emotes))
/datum/idle_behavior/idle_monkey/pun_pun
common_emotes = list(

View File

@@ -151,7 +151,7 @@ Example:
```dm
/datum/ai_planning_subtree/item_ghost_resist/SetupSubtree(datum/ai_controller/controller)
RegisterSignal(controller.pawn, COMSIG_ITEM_EQUIPPED, .proc/on_equip)
RegisterSignal(controller.pawn, COMSIG_ITEM_EQUIPPED, PROC_REF(on_equip))
controller.blackboard[BB_LIKES_EQUIPPER] = FALSE
controller.blackboard[BB_ITEM_AGGRO_LIST] = list()

View File

@@ -73,7 +73,7 @@
. = ..()
if(controller.blackboard[BB_MONKEY_PICKPOCKETING]) //We are pickpocketing, don't do ANYTHING!!!!
return
INVOKE_ASYNC(src, .proc/attempt_pickpocket, controller)
INVOKE_ASYNC(src, PROC_REF(attempt_pickpocket), controller)
/datum/ai_behavior/monkey_equip/pickpocket/proc/attempt_pickpocket(datum/ai_controller/controller)
var/obj/item/target = controller.blackboard[BB_MONKEY_PICKUPTARGET]
@@ -279,7 +279,7 @@
return
if(living_pawn.Adjacent(disposal))
INVOKE_ASYNC(src, .proc/try_disposal_mob, controller, attack_target_key, disposal_target_key) //put him in!
INVOKE_ASYNC(src, PROC_REF(try_disposal_mob), controller, attack_target_key, disposal_target_key) //put him in!
else //This means we might be getting pissed!
return

View File

@@ -53,18 +53,18 @@ have ways of interacting with a specific mob and control it.
return AI_CONTROLLER_INCOMPATIBLE
var/mob/living/living_pawn = new_pawn
RegisterSignal(new_pawn, COMSIG_PARENT_ATTACKBY, .proc/on_attackby)
RegisterSignal(new_pawn, COMSIG_ATOM_ATTACK_HAND, .proc/on_attack_hand)
RegisterSignal(new_pawn, COMSIG_ATOM_ATTACK_PAW, .proc/on_attack_paw)
RegisterSignal(new_pawn, COMSIG_ATOM_ATTACK_ANIMAL, .proc/on_attack_animal)
RegisterSignal(new_pawn, COMSIG_MOB_ATTACK_ALIEN, .proc/on_attack_alien)
RegisterSignal(new_pawn, COMSIG_ATOM_BULLET_ACT, .proc/on_bullet_act)
RegisterSignal(new_pawn, COMSIG_ATOM_HITBY, .proc/on_hitby)
RegisterSignal(new_pawn, COMSIG_LIVING_START_PULL, .proc/on_startpulling)
RegisterSignal(new_pawn, COMSIG_LIVING_TRY_SYRINGE, .proc/on_try_syringe)
RegisterSignal(new_pawn, COMSIG_ATOM_HULK_ATTACK, .proc/on_attack_hulk)
RegisterSignal(new_pawn, COMSIG_CARBON_CUFF_ATTEMPTED, .proc/on_attempt_cuff)
RegisterSignal(new_pawn, COMSIG_MOB_MOVESPEED_UPDATED, .proc/update_movespeed)
RegisterSignal(new_pawn, COMSIG_PARENT_ATTACKBY, PROC_REF(on_attackby))
RegisterSignal(new_pawn, COMSIG_ATOM_ATTACK_HAND, PROC_REF(on_attack_hand))
RegisterSignal(new_pawn, COMSIG_ATOM_ATTACK_PAW, PROC_REF(on_attack_paw))
RegisterSignal(new_pawn, COMSIG_ATOM_ATTACK_ANIMAL, PROC_REF(on_attack_animal))
RegisterSignal(new_pawn, COMSIG_MOB_ATTACK_ALIEN, PROC_REF(on_attack_alien))
RegisterSignal(new_pawn, COMSIG_ATOM_BULLET_ACT, PROC_REF(on_bullet_act))
RegisterSignal(new_pawn, COMSIG_ATOM_HITBY, PROC_REF(on_hitby))
RegisterSignal(new_pawn, COMSIG_LIVING_START_PULL, PROC_REF(on_startpulling))
RegisterSignal(new_pawn, COMSIG_LIVING_TRY_SYRINGE, PROC_REF(on_try_syringe))
RegisterSignal(new_pawn, COMSIG_ATOM_HULK_ATTACK, PROC_REF(on_attack_hulk))
RegisterSignal(new_pawn, COMSIG_CARBON_CUFF_ATTEMPTED, PROC_REF(on_attempt_cuff))
RegisterSignal(new_pawn, COMSIG_MOB_MOVESPEED_UPDATED, PROC_REF(update_movespeed))
movement_delay = living_pawn.cached_multiplicative_slowdown
return ..() //Run parent at end

View File

@@ -8,8 +8,8 @@
var/min_dist = controller.blackboard[BB_CURRENT_MIN_MOVE_DISTANCE]
var/delay = controller.movement_delay
var/datum/move_loop/loop = SSmove_manager.move_to(moving, current_movement_target, min_dist, delay, subsystem = SSai_movement, extra_info = controller)
RegisterSignal(loop, COMSIG_MOVELOOP_PREPROCESS_CHECK, .proc/pre_move)
RegisterSignal(loop, COMSIG_MOVELOOP_POSTPROCESS, .proc/post_move)
RegisterSignal(loop, COMSIG_MOVELOOP_PREPROCESS_CHECK, PROC_REF(pre_move))
RegisterSignal(loop, COMSIG_MOVELOOP_POSTPROCESS, PROC_REF(post_move))
/datum/ai_movement/basic_avoidance/allowed_to_move(datum/move_loop/has_target/dist_bound/source)
. = ..()

View File

@@ -8,8 +8,8 @@
var/atom/movable/moving = controller.pawn
var/delay = controller.movement_delay
var/datum/move_loop/loop = SSmove_manager.move_towards_legacy(moving, current_movement_target, delay, subsystem = SSai_movement, extra_info = controller)
RegisterSignal(loop, COMSIG_MOVELOOP_PREPROCESS_CHECK, .proc/pre_move)
RegisterSignal(loop, COMSIG_MOVELOOP_POSTPROCESS, .proc/post_move)
RegisterSignal(loop, COMSIG_MOVELOOP_PREPROCESS_CHECK, PROC_REF(pre_move))
RegisterSignal(loop, COMSIG_MOVELOOP_POSTPROCESS, PROC_REF(post_move))
/datum/ai_movement/dumb/allowed_to_move(datum/move_loop/has_target/source)
. = ..()

View File

@@ -19,9 +19,9 @@
subsystem = SSai_movement,
extra_info = controller)
RegisterSignal(loop, COMSIG_MOVELOOP_PREPROCESS_CHECK, .proc/pre_move)
RegisterSignal(loop, COMSIG_MOVELOOP_POSTPROCESS, .proc/post_move)
RegisterSignal(loop, COMSIG_MOVELOOP_JPS_REPATH, .proc/repath_incoming)
RegisterSignal(loop, COMSIG_MOVELOOP_PREPROCESS_CHECK, PROC_REF(pre_move))
RegisterSignal(loop, COMSIG_MOVELOOP_POSTPROCESS, PROC_REF(post_move))
RegisterSignal(loop, COMSIG_MOVELOOP_JPS_REPATH, PROC_REF(repath_incoming))
/datum/ai_movement/jps/proc/repath_incoming(datum/move_loop/has_target/jps/source)
SIGNAL_HANDLER

View File

@@ -19,7 +19,7 @@
controller.blackboard[BB_VENDING_BUSY_TILTING] = TRUE
var/turf/target_turf = get_turf(controller.blackboard[BB_VENDING_CURRENT_TARGET])
new /obj/effect/temp_visual/telegraphing/vending_machine_tilt(target_turf)
addtimer(CALLBACK(src, .proc/tiltonmob, controller, target_turf), time_to_tilt)
addtimer(CALLBACK(src, PROC_REF(tiltonmob), controller, target_turf), time_to_tilt)
/datum/ai_behavior/vendor_crush/proc/tiltonmob(datum/ai_controller/controller, turf/target_turf)
var/obj/machinery/vending/vendor_pawn = controller.pawn

View File

@@ -26,10 +26,10 @@
if(!ishostile(new_pawn))
return AI_CONTROLLER_INCOMPATIBLE
RegisterSignal(new_pawn, COMSIG_PARENT_EXAMINE, .proc/on_examined)
RegisterSignal(new_pawn, COMSIG_CLICK_ALT, .proc/check_altclicked)
RegisterSignal(new_pawn, COMSIG_RIDDEN_DRIVER_MOVE, .proc/on_ridden_driver_move)
RegisterSignal(new_pawn, COMSIG_MOVABLE_PREBUCKLE, .proc/on_prebuckle)
RegisterSignal(new_pawn, COMSIG_PARENT_EXAMINE, PROC_REF(on_examined))
RegisterSignal(new_pawn, COMSIG_CLICK_ALT, PROC_REF(check_altclicked))
RegisterSignal(new_pawn, COMSIG_RIDDEN_DRIVER_MOVE, PROC_REF(on_ridden_driver_move))
RegisterSignal(new_pawn, COMSIG_MOVABLE_PREBUCKLE, PROC_REF(on_prebuckle))
return ..() //Run parent at end
/datum/ai_controller/hostile_friend/UnpossessPawn(destroy)
@@ -81,8 +81,8 @@
if(in_range(pawn, new_friend))
new_friend.visible_message("<b>[pawn]</b> looks at [new_friend] in a friendly manner!", span_notice("[pawn] looks at you in a friendly manner!"))
blackboard[BB_HOSTILE_FRIEND] = friend_ref
RegisterSignal(new_friend, COMSIG_MOB_POINTED, .proc/check_point)
RegisterSignal(new_friend, COMSIG_MOB_SAY, .proc/check_verbal_command)
RegisterSignal(new_friend, COMSIG_MOB_POINTED, PROC_REF(check_point))
RegisterSignal(new_friend, COMSIG_MOB_SAY, PROC_REF(check_verbal_command))
/// Someone is being mean to us, take them off our friends (add actual enemies behavior later)
/datum/ai_controller/hostile_friend/proc/unfriend()
@@ -112,7 +112,7 @@
if(!istype(clicker) || blackboard[BB_HOSTILE_FRIEND] == WEAKREF(clicker))
return
. = COMPONENT_CANCEL_CLICK_ALT
INVOKE_ASYNC(src, .proc/command_radial, clicker)
INVOKE_ASYNC(src, PROC_REF(command_radial), clicker)
/// Show the command radial menu
/datum/ai_controller/hostile_friend/proc/command_radial(mob/living/clicker)
@@ -122,7 +122,7 @@
COMMAND_ATTACK = image(icon = 'icons/effects/effects.dmi', icon_state = "bite"),
)
var/choice = show_radial_menu(clicker, pawn, commands, custom_check = CALLBACK(src, .proc/check_menu, clicker), tooltips = TRUE)
var/choice = show_radial_menu(clicker, pawn, commands, custom_check = CALLBACK(src, PROC_REF(check_menu), clicker), tooltips = TRUE)
if(!choice || !check_menu(clicker))
return
set_command_mode(clicker, choice)

View File

@@ -20,9 +20,9 @@
/datum/ai_controller/robot_customer/TryPossessPawn(atom/new_pawn)
if(!istype(new_pawn, /mob/living/simple_animal/robot_customer))
return AI_CONTROLLER_INCOMPATIBLE
RegisterSignal(new_pawn, COMSIG_PARENT_ATTACKBY, .proc/on_attackby)
RegisterSignal(new_pawn, COMSIG_LIVING_GET_PULLED, .proc/on_get_pulled)
RegisterSignal(new_pawn, COMSIG_ATOM_ATTACK_HAND, .proc/on_get_punched)
RegisterSignal(new_pawn, COMSIG_PARENT_ATTACKBY, PROC_REF(on_attackby))
RegisterSignal(new_pawn, COMSIG_LIVING_GET_PULLED, PROC_REF(on_get_pulled))
RegisterSignal(new_pawn, COMSIG_ATOM_ATTACK_HAND, PROC_REF(on_get_punched))
return ..() //Run parent at end
/datum/ai_controller/robot_customer/UnpossessPawn(destroy)
@@ -37,7 +37,7 @@
eat_order(I, attending_venue)
return COMPONENT_NO_AFTERATTACK
else
INVOKE_ASYNC(src, .proc/warn_greytider, user)
INVOKE_ASYNC(src, PROC_REF(warn_greytider), user)
/datum/ai_controller/robot_customer/proc/eat_order(obj/item/order_item, datum/venue/attending_venue)
@@ -55,7 +55,7 @@
SIGNAL_HANDLER
INVOKE_ASYNC(src, .proc/async_on_get_pulled, source, puller)
INVOKE_ASYNC(src, PROC_REF(async_on_get_pulled), source, puller)
/datum/ai_controller/robot_customer/proc/async_on_get_pulled(datum/source, mob/living/puller)
var/mob/living/simple_animal/robot_customer/customer = pawn
@@ -104,4 +104,4 @@
return
if(living_hitter.combat_mode)
INVOKE_ASYNC(src, .proc/warn_greytider, living_hitter)
INVOKE_ASYNC(src, PROC_REF(warn_greytider), living_hitter)

View File

@@ -111,8 +111,8 @@
src.allowed_z_levels = allowed_z_levels
src.allowed_areas = allowed_areas
for(var/alarm_type in alarms_to_listen_for)
RegisterSignal(SSdcs, COMSIG_GLOB_ALARM_FIRE(alarm_type), .proc/add_alarm)
RegisterSignal(SSdcs, COMSIG_GLOB_ALARM_CLEAR(alarm_type), .proc/clear_alarm)
RegisterSignal(SSdcs, COMSIG_GLOB_ALARM_FIRE(alarm_type), PROC_REF(add_alarm))
RegisterSignal(SSdcs, COMSIG_GLOB_ALARM_CLEAR(alarm_type), PROC_REF(clear_alarm))
return ..()
@@ -146,7 +146,7 @@
var/list/cameras = source_area.cameras
if(optional_camera)
cameras = list(optional_camera) // This will cause harddels, so we need to clear manually
RegisterSignal(optional_camera, COMSIG_PARENT_QDELETING, .proc/clear_camera_ref, override = TRUE) //It's just fine to override, cause we clear all refs in the proc
RegisterSignal(optional_camera, COMSIG_PARENT_QDELETING, PROC_REF(clear_camera_ref), override = TRUE) //It's just fine to override, cause we clear all refs in the proc
//This does mean that only the first alarm of that camera type in the area will send a ping, but jesus what else can ya do
alarms_of_our_type[source_area.name] = list(source_area, cameras, list(handler))

View File

@@ -66,8 +66,8 @@
visuals.vis_flags = VIS_INHERIT_PLANE
visuals.update_appearance()
Draw()
RegisterSignal(origin, COMSIG_MOVABLE_MOVED, .proc/redrawing)
RegisterSignal(target, COMSIG_MOVABLE_MOVED, .proc/redrawing)
RegisterSignal(origin, COMSIG_MOVABLE_MOVED, PROC_REF(redrawing))
RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(redrawing))
/**
* Triggered by signals set up when the beam is set up. If it's still sane to create a beam, it removes the old beam, creates a new one. Otherwise it kills the beam.
@@ -81,7 +81,7 @@
SIGNAL_HANDLER
if(origin && target && get_dist(origin,target)<max_distance && origin.z == target.z)
QDEL_LIST(elements)
INVOKE_ASYNC(src, .proc/Draw)
INVOKE_ASYNC(src, PROC_REF(Draw))
else
qdel(src)
@@ -198,7 +198,7 @@
*/
/atom/proc/Beam(atom/BeamTarget,icon_state="b_beam",icon='icons/effects/beam.dmi',time=INFINITY,maxdistance=INFINITY,beam_type=/obj/effect/ebeam, beam_color = null, override_origin_pixel_x = null, override_origin_pixel_y = null, override_target_pixel_x = null, override_target_pixel_y = null)
var/datum/beam/newbeam = new(src,BeamTarget,icon,icon_state,time,maxdistance,beam_type, beam_color, override_origin_pixel_x, override_origin_pixel_y, override_target_pixel_x, override_target_pixel_y )
INVOKE_ASYNC(newbeam, /datum/beam/.proc/Start)
INVOKE_ASYNC(newbeam, TYPE_PROC_REF(/datum/beam/, Start))
return newbeam

View File

@@ -35,8 +35,8 @@
/datum/brain_trauma/proc/on_gain()
if(gain_text)
to_chat(owner, gain_text)
RegisterSignal(owner, COMSIG_MOB_SAY, .proc/handle_speech)
RegisterSignal(owner, COMSIG_MOVABLE_HEAR, .proc/handle_hearing)
RegisterSignal(owner, COMSIG_MOB_SAY, PROC_REF(handle_speech))
RegisterSignal(owner, COMSIG_MOVABLE_HEAR, PROC_REF(handle_hearing))
//Called when removed from a mob
/datum/brain_trauma/proc/on_lose(silent)

View File

@@ -29,12 +29,12 @@
owner.mind.add_antag_datum(/datum/antagonist/obsessed)
antagonist = owner.mind.has_antag_datum(/datum/antagonist/obsessed)
antagonist.trauma = src
RegisterSignal(obsession, COMSIG_MOB_EYECONTACT, .proc/stare)
RegisterSignal(obsession, COMSIG_MOB_EYECONTACT, PROC_REF(stare))
..()
//antag stuff//
antagonist.forge_objectives(obsession.mind)
antagonist.greet()
RegisterSignal(owner, COMSIG_CARBON_HELPED, .proc/on_hug)
RegisterSignal(owner, COMSIG_CARBON_HELPED, PROC_REF(on_hug))
/datum/brain_trauma/special/obsessed/on_life(delta_time, times_fired)
if(!obsession || obsession.stat == DEAD)
@@ -75,7 +75,7 @@
return
if(prob(25)) // 25% chances to be nervous and stutter.
if(prob(50)) // 12.5% chance (previous check taken into account) of doing something suspicious.
addtimer(CALLBACK(src, .proc/on_failed_social_interaction), rand(1, 3) SECONDS)
addtimer(CALLBACK(src, PROC_REF(on_failed_social_interaction)), rand(1, 3) SECONDS)
else if(!owner.has_status_effect(/datum/status_effect/speech/stutter))
to_chat(owner, span_warning("Being near [obsession] makes you nervous and you begin to stutter..."))
owner.set_stutter_if_lower(6 SECONDS)
@@ -94,16 +94,16 @@
return
switch(rand(1, 100))
if(1 to 40)
INVOKE_ASYNC(owner, /mob.proc/emote, pick("blink", "blink_r"))
INVOKE_ASYNC(owner, TYPE_PROC_REF(/mob, emote), pick("blink", "blink_r"))
owner.blur_eyes(10)
to_chat(owner, span_userdanger("You sweat profusely and have a hard time focusing..."))
if(41 to 80)
INVOKE_ASYNC(owner, /mob.proc/emote, "pale")
INVOKE_ASYNC(owner, TYPE_PROC_REF(/mob, emote), "pale")
shake_camera(owner, 15, 1)
owner.adjustStaminaLoss(70)
to_chat(owner, span_userdanger("You feel your heart lurching in your chest..."))
if(81 to 100)
INVOKE_ASYNC(owner, /mob.proc/emote, "cough")
INVOKE_ASYNC(owner, TYPE_PROC_REF(/mob, emote), "cough")
owner.adjust_dizzy(20 SECONDS)
owner.adjust_disgust(5)
to_chat(owner, span_userdanger("You gag and swallow a bit of bile..."))
@@ -115,7 +115,7 @@
if(examining_mob != owner || !triggering_examiner || prob(50))
return
addtimer(CALLBACK(GLOBAL_PROC, .proc/to_chat, obsession, span_warning("You catch [examining_mob] staring at you..."), 3))
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(to_chat), obsession, span_warning("You catch [examining_mob] staring at you..."), 3))
return COMSIG_BLOCK_EYECONTACT
/datum/brain_trauma/special/obsessed/proc/find_obsession()

View File

@@ -23,7 +23,7 @@
qdel(src)
return
if(!friend.client && friend_initialized)
addtimer(CALLBACK(src, .proc/reroll_friend), 600)
addtimer(CALLBACK(src, PROC_REF(reroll_friend)), 600)
/datum/brain_trauma/special/imaginary_friend/on_death()
..()
@@ -98,9 +98,9 @@
owner = imaginary_friend_owner
if(appearance_from_prefs)
INVOKE_ASYNC(src, .proc/setup_friend_from_prefs, appearance_from_prefs)
INVOKE_ASYNC(src, PROC_REF(setup_friend_from_prefs), appearance_from_prefs)
else
INVOKE_ASYNC(src, .proc/setup_friend)
INVOKE_ASYNC(src, PROC_REF(setup_friend))
join = new
join.Grant(src)
@@ -217,9 +217,9 @@
var/image/bubble = mutable_appearance('icons/mob/effects/talk.dmi', src, "default[say_test(message)]", FLY_LAYER)
SET_PLANE_EXPLICIT(bubble, ABOVE_GAME_PLANE, src)
bubble.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
INVOKE_ASYNC(GLOBAL_PROC, /proc/flick_overlay, bubble, list(owner.client), 30)
INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(flick_overlay), bubble, list(owner.client), 30)
LAZYADD(update_on_z, bubble)
addtimer(CALLBACK(src, .proc/clear_saypopup, bubble), 3.5 SECONDS)
addtimer(CALLBACK(src, PROC_REF(clear_saypopup), bubble), 3.5 SECONDS)
for(var/mob/M in GLOB.dead_mob_list)
var/link = FOLLOW_LINK(M, owner)

View File

@@ -178,8 +178,8 @@
to_chat(owner, span_warning("[pick("You have a coughing fit!", "You can't stop coughing!")]"))
owner.Immobilize(20)
owner.emote("cough")
addtimer(CALLBACK(owner, /mob/.proc/emote, "cough"), 6)
addtimer(CALLBACK(owner, /mob/.proc/emote, "cough"), 12)
addtimer(CALLBACK(owner, TYPE_PROC_REF(/mob/, emote), "cough"), 6)
addtimer(CALLBACK(owner, TYPE_PROC_REF(/mob/, emote), "cough"), 12)
owner.emote("cough")
..()

View File

@@ -85,7 +85,7 @@
if(!owner.has_language(hearing_args[HEARING_LANGUAGE])) //can't be triggered if you don't know the language
return
if(trigger_regex.Find(hearing_args[HEARING_RAW_MESSAGE]) != 0)
addtimer(CALLBACK(src, .proc/freak_out, null, trigger_regex.group[2]), 10) //to react AFTER the chat message
addtimer(CALLBACK(src, PROC_REF(freak_out), null, trigger_regex.group[2]), 10) //to react AFTER the chat message
hearing_args[HEARING_RAW_MESSAGE] = trigger_regex.Replace(hearing_args[HEARING_RAW_MESSAGE], "[span_phobia("$2")]$3")
/datum/brain_trauma/mild/phobia/handle_speech(datum/source, list/speech_args)

View File

@@ -185,7 +185,7 @@
to_chat(owner, span_warning("You feel really sick at the thought of being alone!"))
else
to_chat(owner, span_warning("You feel sick..."))
addtimer(CALLBACK(owner, /mob/living/carbon.proc/vomit, high_stress), 50) //blood vomit if high stress
addtimer(CALLBACK(owner, TYPE_PROC_REF(/mob/living/carbon, vomit), high_stress), 50) //blood vomit if high stress
if(2)
if(high_stress)
to_chat(owner, span_warning("You feel weak and scared! If only you weren't alone..."))
@@ -294,7 +294,7 @@
var/regex/reg = new("(\\b[REGEX_QUOTE(trigger_phrase)]\\b)","ig")
if(findtext(hearing_args[HEARING_RAW_MESSAGE], reg))
addtimer(CALLBACK(src, .proc/hypnotrigger), 10) //to react AFTER the chat message
addtimer(CALLBACK(src, PROC_REF(hypnotrigger)), 10) //to react AFTER the chat message
hearing_args[HEARING_RAW_MESSAGE] = reg.Replace(hearing_args[HEARING_RAW_MESSAGE], span_hypnophrase("*********"))
/datum/brain_trauma/severe/hypnotic_trigger/proc/hypnotrigger()

View File

@@ -216,7 +216,7 @@
to_chat(owner, span_warning("Your connection to [linked_target] suddenly feels extremely strong... you can feel it pulling you!"))
owner.playsound_local(owner, 'sound/magic/lightning_chargeup.ogg', 75, FALSE)
returning = TRUE
addtimer(CALLBACK(src, .proc/snapback), 100)
addtimer(CALLBACK(src, PROC_REF(snapback)), 100)
/datum/brain_trauma/special/quantum_alignment/proc/snapback()
returning = FALSE
@@ -292,7 +292,7 @@
/datum/brain_trauma/special/death_whispers/proc/whispering()
ADD_TRAIT(owner, TRAIT_SIXTHSENSE, TRAUMA_TRAIT)
active = TRUE
addtimer(CALLBACK(src, .proc/cease_whispering), rand(50, 300))
addtimer(CALLBACK(src, PROC_REF(cease_whispering)), rand(50, 300))
/datum/brain_trauma/special/death_whispers/proc/cease_whispering()
REMOVE_TRAIT(owner, TRAIT_SIXTHSENSE, TRAUMA_TRAIT)
@@ -333,7 +333,7 @@
"You simply fade away.")]</span>")
owner.forceMove(veil)
COOLDOWN_START(src, crisis_cooldown, 1 MINUTES)
addtimer(CALLBACK(src, .proc/fade_in), duration)
addtimer(CALLBACK(src, PROC_REF(fade_in)), duration)
/datum/brain_trauma/special/existential_crisis/proc/fade_in()
QDEL_NULL(veil)

Some files were not shown because too many files have changed in this diff Show More