Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function overloads condensation #18939

Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions SpacemanDMM.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ invalid_lint_directive_value = "error"
invalid_set_value = "error"
unknown_linter_setting = "error"
override_missing_keyword_arg = "error"
must_not_override = "error"
must_call_parent = "error"
final_var = "error"
private_var = "error"
protected_var = "error"
must_be_pure = "error"
must_not_sleep = "error"
redefined_proc = "error"
ambiguous_in_lhs = "error"
ambiguous_not_bitwise = "error"
no_typehint_implicit_new = "error"
Expand Down
14 changes: 0 additions & 14 deletions code/ZAS/Phoron.dm
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,3 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi')
if(w_uniform) w_uniform.contaminate()
if(shoes) shoes.contaminate()
if(gloves) gloves.contaminate()


/turf/Entered(atom/movable/thing, turf/oldLoc)
. = ..(thing, oldLoc)
//Items that are in phoron, but not on a mob, can still be contaminated.
var/obj/item/I = thing
if(istype(I) && vsc.plc.CLOTH_CONTAMINATION && I.can_contaminate())
var/datum/gas_mixture/env = return_air(1)
if(!env)
return
for(var/g in env.gas)
if(gas_data.flags[g] & XGM_GAS_CONTAMINANT && env.gas[g] > gas_data.overlay_limit[g] + 1)
I.contaminate()
break
2 changes: 2 additions & 0 deletions code/__DEFINES/profiler_tracy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ var/byond_tracy_running = 0 // Whether byond-tracy is currently running or not
var/byond_tracy_running_v = null // Which version of byond-tracy is currently running, so we call the right binary on destruction.

/world/New()
CAN_BE_REDEFINED(TRUE)
if(GLOB.config.enable_byond_tracy)
prof_init("tracy_disk") // This start's Affectedarc07's version of Tracy. Writing a .utracy file to the disk.
. = ..()

/world/Del()
CAN_BE_REDEFINED(TRUE)
if(byond_tracy_running)
prof_destroy()
. = ..()
Expand Down
20 changes: 20 additions & 0 deletions code/__DEFINES/tgs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
* * minimum_required_security_level: The minimum required security level to run the game in which the DMAPI is integrated. Can be one of [TGS_SECURITY_ULTRASAFE], [TGS_SECURITY_SAFE], or [TGS_SECURITY_TRUSTED].
*/
/world/proc/TgsNew(datum/tgs_event_handler/event_handler, minimum_required_security_level = TGS_SECURITY_ULTRASAFE)
CAN_BE_REDEFINED(TRUE)
return

/**
Expand All @@ -155,6 +156,7 @@
* This function should not be called before ..() in [/world/proc/New].
*/
/world/proc/TgsInitializationComplete()
CAN_BE_REDEFINED(TRUE)
return

/// Put this at the start of [/world/proc/Topic].
Expand All @@ -164,6 +166,7 @@
* Call this as late as possible in [world/proc/Reboot] (BEFORE ..()).
*/
/world/proc/TgsReboot()
CAN_BE_REDEFINED(TRUE)
return

// DATUM DEFINITIONS
Expand Down Expand Up @@ -201,6 +204,7 @@
* Returns [TRUE]/[FALSE] based on if the [/datum/tgs_version] contains wildcards.
*/
/datum/tgs_version/proc/Wildcard()
CAN_BE_REDEFINED(TRUE)
return

/**
Expand All @@ -209,6 +213,7 @@
* other_version - The [/datum/tgs_version] to compare against.
*/
/datum/tgs_version/proc/Equals(datum/tgs_version/other_version)
CAN_BE_REDEFINED(TRUE)
return

/// Represents a merge of a GitHub pull request.
Expand Down Expand Up @@ -395,16 +400,19 @@

/// Returns the maximum supported [/datum/tgs_version] of the DMAPI.
/world/proc/TgsMaximumApiVersion()
CAN_BE_REDEFINED(TRUE)
return

/// Returns the minimum supported [/datum/tgs_version] of the DMAPI.
/world/proc/TgsMinimumApiVersion()
CAN_BE_REDEFINED(TRUE)
return

/**
* Returns [TRUE] if DreamDaemon was launched under TGS, the API matches, and was properly initialized. [FALSE] will be returned otherwise.
*/
/world/proc/TgsAvailable()
CAN_BE_REDEFINED(TRUE)
return

// No function below this succeeds if it TgsAvailable() returns FALSE or if TgsNew() has yet to be called.
Expand All @@ -416,6 +424,7 @@
* If TGS has not requested a [TGS_REBOOT_MODE_SHUTDOWN] DreamDaemon will be launched again.
*/
/world/proc/TgsEndProcess()
CAN_BE_REDEFINED(TRUE)
return

/**
Expand All @@ -425,6 +434,7 @@
* admin_only: If [TRUE], message will be sent to admin connected chats. Vice-versa applies.
*/
/world/proc/TgsTargetedChatBroadcast(datum/tgs_message_content/message, admin_only = FALSE)
CAN_BE_REDEFINED(TRUE)
return

/**
Expand All @@ -434,6 +444,7 @@
* user: The [/datum/tgs_chat_user] to PM.
*/
/world/proc/TgsChatPrivateMessage(datum/tgs_message_content/message, datum/tgs_chat_user/user)
CAN_BE_REDEFINED(TRUE)
return

/**
Expand All @@ -443,38 +454,47 @@
* channels - Optional list of [/datum/tgs_chat_channel]s to restrict the message to.
*/
/world/proc/TgsChatBroadcast(datum/tgs_message_content/message, list/channels = null)
CAN_BE_REDEFINED(TRUE)
return

/// Returns the current [/datum/tgs_version] of TGS if it is running the server, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsVersion()
CAN_BE_REDEFINED(TRUE)
return

/// Returns the current [/datum/tgs_version] of the DMAPI being used if it was activated, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsApiVersion()
CAN_BE_REDEFINED(TRUE)
return

/// Returns the name of the TGS instance running the game if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsInstanceName()
CAN_BE_REDEFINED(TRUE)
return

/// Return the current [/datum/tgs_revision_information] of the running server if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsRevision()
CAN_BE_REDEFINED(TRUE)
return

/// Returns the current BYOND security level as a TGS_SECURITY_ define if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsSecurityLevel()
CAN_BE_REDEFINED(TRUE)
return

/// Returns the current BYOND visibility level as a TGS_VISIBILITY_ define if TGS is present, null otherwise. Requires TGS to be using interop API version 5 or higher otherwise the string "___unimplemented" wil be returned. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsVisibility()
CAN_BE_REDEFINED(TRUE)
return

/// Returns a list of active [/datum/tgs_revision_information/test_merge]s if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsTestMerges()
CAN_BE_REDEFINED(TRUE)
return

/// Returns a list of connected [/datum/tgs_chat_channel]s if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsChatChannelInfo()
CAN_BE_REDEFINED(TRUE)
return

/*
Expand Down
1 change: 1 addition & 0 deletions code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ Proc for attack log creation, because really why not
if((src in GLOB.living_mob_list) || (src in GLOB.dead_mob_list))
return FALSE
GLOB.dead_mob_list += src
GLOB.death_event.raise_event(src)
return TRUE

// Returns true if the mob was removed form the dead list
Expand Down
4 changes: 4 additions & 0 deletions code/___linters/spaceman_dmm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
///If wrapped in this, will not lint.
#define UNLINT(X) SpacemanDMM_unlint(X)

///The proc can be redefined in other parts of the codebase
#define CAN_BE_REDEFINED(X) set SpacemanDMM_can_be_redefined = X

///If set, overriding their value isn't permitted by types that inherit it.
#define VAR_FINAL var/SpacemanDMM_final

Expand All @@ -77,6 +80,7 @@
#define SHOULD_BE_PURE(X)
#define PRIVATE_PROC(X)
#define PROTECTED_PROC(X)
#define CAN_BE_REDEFINED(X)
#define VAR_FINAL var
#define VAR_PRIVATE var
#define VAR_PROTECTED var
Expand Down
16 changes: 9 additions & 7 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
var/datum/click_handler/click_handler = usr.GetClickHandler()
click_handler.OnDblClick(src, params)

if(istype(usr.machine,/obj/machinery/computer/security))
var/obj/machinery/computer/security/console = usr.machine
console.jump_on_click(usr,src)

/atom/proc/allow_click_through(var/atom/A, var/params, var/mob/user)
return FALSE

Expand Down Expand Up @@ -204,10 +208,13 @@
/mob/living/UnarmedAttack(var/atom/A, var/proximity_flag)
if(!(GAME_STATE & RUNLEVELS_PLAYING))
to_chat(src, "You cannot attack people before the game has started.")
return 0
return FALSE

if(stat)
return 0
return FALSE

if(check_sting(src, A))
return FALSE

return 1

Expand Down Expand Up @@ -422,11 +429,6 @@ var/global/list/click_catchers
/mob
var/datum/stack/click_handlers

/mob/Destroy()
if(click_handlers)
click_handlers.QdelClear()
QDEL_NULL(click_handlers)
. = ..()

var/const/CLICK_HANDLER_NONE = 0
var/const/CLICK_HANDLER_REMOVE_ON_MOB_LOGOUT = 1
Expand Down
10 changes: 0 additions & 10 deletions code/_onclick/hud/ability_screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,6 @@
return O
return

/mob/living/LateLogin()
. = ..()
if(ability_master)
ability_master.toggle_open(2)
client.screen -= ability_master

/mob/living/Initialize()
. = ..()
ability_master = new /obj/screen/movable/ability_master(FALSE, src)

///////////ACTUAL ABILITIES////////////
//This is what you click to do things//
///////////////////////////////////////
Expand Down
6 changes: 0 additions & 6 deletions code/_onclick/hud/skybox.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,3 @@
. = ..()
if(. && client)
client.update_skybox(old_z != GET_Z(src))

/mob/forceMove()
var/old_z = GET_Z(src)
. = ..()
if(. && client)
client.update_skybox(old_z != GET_Z(src))
7 changes: 0 additions & 7 deletions code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@ avoid code duplication. This includes items that may sometimes act as a standard
return TRUE
return ..()

/mob/living/simple_animal/attackby(obj/item/I, mob/living/user)
if(I.damtype == DAMAGE_PAIN)
playsound(loc, 'sound/weapons/tap.ogg', I.get_clamped_volume(), 1, -1)
return TRUE
else
return ..()

// Proximity_flag is 1 if this afterattack was called on something adjacent, in your square, or on your person.
// Click parameters is the params string from byond Click() code, see that documentation.
/obj/item/proc/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
Expand Down
8 changes: 5 additions & 3 deletions code/_onclick/other_mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
/mob/proc/attack_empty_hand(var/bp_hand)
return

/mob/living/carbon/human/RestrainedClickOn(var/atom/A)
return

/mob/living/carbon/human/RangedAttack(var/atom/A)
var/obj/item/clothing/gloves/GV = gloves
var/obj/item/clothing/glasses/GS = glasses
Expand Down Expand Up @@ -174,5 +171,10 @@

/mob/living/CtrlClickOn(var/atom/A)
. = ..()

if(client && client.hardsuit_click_mode == 2) //HARDSUIT_MODE_CTRL_CLICK
if(HardsuitClickOn(A))
return

if(!. && a_intent == I_GRAB && length(available_maneuvers))
. = perform_maneuver(prepared_maneuver || available_maneuvers[1], A)
6 changes: 0 additions & 6 deletions code/_onclick/rig.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@
return
..()

/mob/living/CtrlClickOn(atom/A)
if(client && client.hardsuit_click_mode == HARDSUIT_MODE_CTRL_CLICK)
if(HardsuitClickOn(A))
return
..()

/mob/living/proc/can_use_rig()
return 0

Expand Down
3 changes: 0 additions & 3 deletions code/controllers/subsystems/icon_updates.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ SUBSYSTEM_DEF(icon_update)
///Deferred list, contains atoms that were not ready to be processed in the previous run
VAR_PRIVATE/list/deferred = list()

/datum/controller/subsystem/icon_update/New()
NEW_SS_GLOBAL(SSicon_update)

/datum/controller/subsystem/icon_update/stat_entry(msg)
msg = "QU:[icon_update_queue.len]"
return ..()
Expand Down
1 change: 1 addition & 0 deletions code/controllers/subsystems/processing/airflow.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ PROCESSING_SUBSYSTEM_DEF(airflow)
priority = SS_PRIORITY_AIRFLOW

/datum/controller/subsystem/processing/airflow/fire(resumed = FALSE)
CAN_BE_REDEFINED(TRUE)
if (!resumed)
currentrun = processing.Copy() // Defined in parent.

Expand Down
3 changes: 0 additions & 3 deletions code/controllers/subsystems/processing/nanoui.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ PROCESSING_SUBSYSTEM_DEF(nanoui)
// NanoUI stuff.
var/list/open_uis = list()

/datum/controller/subsystem/processing/nanoui/New()
NEW_SS_GLOBAL(SSnanoui)

/**
* Get an open /nanoui ui for the current user, src_object and ui_key and try to update it with data
*
Expand Down
1 change: 1 addition & 0 deletions code/controllers/subsystems/processing/ntsl2.dm
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ PROCESSING_SUBSYSTEM_DEF(ntsl2)


/datum/controller/subsystem/processing/ntsl2/fire(resumed)
CAN_BE_REDEFINED(TRUE)
for(var/task_id in tasks)
var/task = tasks[task_id]
var/datum/http_request/req = task["request"]
Expand Down
1 change: 1 addition & 0 deletions code/controllers/subsystems/processing/obj_tab_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ PROCESSING_SUBSYSTEM_DEF(obj_tab_items)
// I know this is mostly copypasta, but I want to change the processing logic
// Sorry bestie :(
/datum/controller/subsystem/processing/obj_tab_items/fire(resumed = FALSE)
CAN_BE_REDEFINED(TRUE)
if (!resumed)
currentrun = processing.Copy()
//cache for sanic speed (lists are references anyways)
Expand Down
1 change: 1 addition & 0 deletions code/controllers/subsystems/processing/psi.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ PROCESSING_SUBSYSTEM_DEF(psi)
var/list/all_psi_complexes = list()

/datum/controller/subsystem/processing/psi/fire(resumed)
CAN_BE_REDEFINED(TRUE)
..()
if((world.time >= (last_nlom_awareness_check + 30 MINUTES)) && !checking_nlom && !completing_nlom)
checking_nlom = TRUE
Expand Down
4 changes: 2 additions & 2 deletions code/controllers/subsystems/processing/tgui.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ PROCESSING_SUBSYSTEM_DEF(tgui)
/// The HTML base used for all UIs.
var/basehtml

/datum/controller/subsystem/processing/tgui/New()
NEW_SS_GLOBAL(SStgui)
/datum/controller/subsystem/processing/tgui/PreInit()
basehtml = file2text('tgui/public/tgui.html')
// Inject inline polyfills
var/polyfill = file2text('tgui/public/tgui-polyfill.min.js')
Expand All @@ -43,6 +42,7 @@ PROCESSING_SUBSYSTEM_DEF(tgui)
return ..()

/datum/controller/subsystem/processing/tgui/fire(resumed = FALSE)
CAN_BE_REDEFINED(TRUE)
if(!resumed)
src.current_run = open_uis.Copy()
// Cache for sanic speed (lists are references anyways)
Expand Down
1 change: 1 addition & 0 deletions code/controllers/subsystems/runechat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ TIMER_SUBSYSTEM_DEF(runechat)
var/list/datum/callback/message_queue = list()

/datum/controller/subsystem/timer/runechat/fire(resumed)
CAN_BE_REDEFINED(TRUE)
. = ..() //poggers
while(message_queue.len)
var/datum/callback/queued_message = message_queue[message_queue.len]
Expand Down
Loading
Loading