Skip to content

Commit

Permalink
516 Compile Compatibility (tgstation#88611)
Browse files Browse the repository at this point in the history
Renames all uses of caller, as they (currently) shadow the new byond var
and will in future error
Ups our "wan if compiled after" experiement compile version to 516
Adds an alternate 516 unit test
  • Loading branch information
LemonInTheDark authored Dec 27, 2024
1 parent 6b252b5 commit 91719a4
Show file tree
Hide file tree
Showing 36 changed files with 282 additions and 277 deletions.
6 changes: 5 additions & 1 deletion .github/alternate_byond_versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
# This is useful for making sure we maintain compatibility with both older and newer versions,
# while still having our main tests run on a guaranteed pinned version.

# Format is version: map
# Format is "version: map" or "version: map;max_required_client_version"
# Example:
# 500.1337: runtimestation
# 516.1638: runtimestation;516
# Lowest supported version
515.1627: runtimestation
# Beta version
516.1648: runtimestation;516
4 changes: 2 additions & 2 deletions .github/workflows/ci_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ jobs:
- name: Find Alternate Tests
id: alternate_test_finder
run: |
ALTERNATE_TESTS_JSON=$(jq -nRc '[inputs | capture("^(?<major>[0-9]+)\\.(?<minor>[0-9]+): (?<map>.+)$")]' .github/alternate_byond_versions.txt)
ALTERNATE_TESTS_JSON=$(jq -nRc '[inputs | capture("^(?<major>[0-9]+)\\.(?<minor>[0-9]+): (?<map>[^;]+);?(?<max_client_version>[0-9]+)?$")]' .github/alternate_byond_versions.txt)
echo "alternate_tests=$ALTERNATE_TESTS_JSON" >> $GITHUB_OUTPUT
- name: Collect byond client version configuration
id: max_required_byond_client
Expand Down Expand Up @@ -219,7 +219,7 @@ jobs:
map: ${{ matrix.setup.map }}
major: ${{ matrix.setup.major }}
minor: ${{ matrix.setup.minor }}
max_required_byond_client: ${{needs.collect_data.outputs.max_required_byond_client}}
max_required_byond_client: ${{ matrix.setup.max_client_version || needs.collect_data.outputs.max_required_byond_client }}

compare_screenshots:
if: needs.collect_data.outputs.alternate_tests == '[]' || needs.run_alternate_tests.result == 'success'
Expand Down
12 changes: 6 additions & 6 deletions code/__HELPERS/paths/path.dm
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@
* Passed into CanAStarPass to provide context for a pathing attempt
*
* Also used to check if using a cached path_map is safe
* There are some vars here that are unused. They exist to cover cases where caller_ref is used
* They're the properties of caller_ref used in those cases.
* There are some vars here that are unused. They exist to cover cases where requester_ref is used
* They're the properties of requester_ref used in those cases.
* It's kinda annoying, but there's some proc chains we can't convert to this datum
*/
/datum/can_pass_info
Expand Down Expand Up @@ -314,7 +314,7 @@
/// Weakref to the requester used to generate this info
/// Should not use this almost ever, it's for context and to allow for proc chains that
/// Require a movable
var/datum/weakref/caller_ref = null
var/datum/weakref/requester_ref = null

/datum/can_pass_info/New(atom/movable/construct_from, list/access, no_id = FALSE, call_depth = 0)
// No infiniloops
Expand All @@ -327,7 +327,7 @@
if(isnull(construct_from))
return

src.caller_ref = WEAKREF(construct_from)
src.requester_ref = WEAKREF(construct_from)
src.pass_flags = construct_from.pass_flags
src.movement_type = construct_from.movement_type
src.thrown = !!construct_from.throwing
Expand Down Expand Up @@ -361,8 +361,8 @@ GLOBAL_LIST_INIT(can_pass_info_vars, GLOBAL_PROC_REF(can_pass_check_vars))
var/datum/isaac = new()
var/list/altar = assoc_to_keys(lamb.vars - isaac.vars)
// Don't compare against calling atom, it's not relevant here
altar -= "caller_ref"
ASSERT("caller_ref" in lamb.vars, "caller_ref var was not found in /datum/can_pass_info, why are we filtering for it?")
altar -= "requester_ref"
ASSERT("requester_ref" in lamb.vars, "requester_ref var was not found in /datum/can_pass_info, why are we filtering for it?")
// We will bespoke handle pulling_info
altar -= "pulling_info"
ASSERT("pulling_info" in lamb.vars, "pulling_info var was not found in /datum/can_pass_info, why are we filtering for it?")
Expand Down
4 changes: 2 additions & 2 deletions code/_experiments.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
#define EXPERIMENT_MY_COOL_FEATURE
#endif

#if DM_VERSION >= 516
#error "Remove all 515 experiments"
#if DM_VERSION >= 517
#error "Remove all 516 experiments"
#endif
6 changes: 3 additions & 3 deletions code/datums/actions/cooldown_action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
return PreActivate(user)

/// Intercepts client owner clicks to activate the ability
/datum/action/cooldown/proc/InterceptClickOn(mob/living/caller, params, atom/target)
/datum/action/cooldown/proc/InterceptClickOn(mob/living/clicker, params, atom/target)
if(!IsAvailable(feedback = TRUE))
return FALSE
if(!target)
Expand All @@ -261,8 +261,8 @@

// And if we reach here, the action was complete successfully
if(unset_after_click)
unset_click_ability(caller, refund_cooldown = FALSE)
caller.next_click = world.time + click_cd_override
unset_click_ability(clicker, refund_cooldown = FALSE)
clicker.next_click = world.time + click_cd_override

return TRUE

Expand Down
8 changes: 4 additions & 4 deletions code/datums/actions/innate_action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@
on_who.click_intercept = null

/// Handles whenever a mob clicks on something
/datum/action/innate/proc/InterceptClickOn(mob/living/caller, params, atom/clicked_on)
/datum/action/innate/proc/InterceptClickOn(mob/living/clicker, params, atom/clicked_on)
if(!IsAvailable(feedback = TRUE))
unset_ranged_ability(caller)
unset_ranged_ability(clicker)
return FALSE
if(!clicked_on)
return FALSE

return do_ability(caller, clicked_on)
return do_ability(clicker, clicked_on)

/// Actually goes through and does the click ability
/datum/action/innate/proc/do_ability(mob/living/caller, atom/clicked_on)
/datum/action/innate/proc/do_ability(mob/living/clicker, atom/clicked_on)
return FALSE

/datum/action/innate/Remove(mob/removed_from)
Expand Down
10 changes: 5 additions & 5 deletions code/datums/components/pet_commands/pet_command.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
try_activate_command(commander = speaker, radial_command = FALSE)

/// Respond to a callout
/datum/pet_command/proc/respond_to_callout(mob/living/caller, datum/callout_option/callout, atom/target)
/datum/pet_command/proc/respond_to_callout(mob/living/speaker, datum/callout_option/callout, atom/target)
SIGNAL_HANDLER

if (isnull(callout_type) || !ispath(callout, callout_type))
Expand All @@ -85,21 +85,21 @@
if (!parent)
return

if (!valid_callout_target(caller, callout, target))
if (!valid_callout_target(speaker, callout, target))
var/found_new_target = FALSE
for (var/atom/new_target in range(2, target))
if (valid_callout_target(caller, callout, new_target))
if (valid_callout_target(speaker, callout, new_target))
target = new_target
found_new_target = TRUE

if (!found_new_target)
return

if (try_activate_command(commander = caller, radial_command = FALSE))
if (try_activate_command(commander = speaker, radial_command = FALSE))
look_for_target(parent, target)

/// Does this callout with this target trigger this command?
/datum/pet_command/proc/valid_callout_target(mob/living/caller, datum/callout_option/callout, atom/target)
/datum/pet_command/proc/valid_callout_target(mob/living/speaker, datum/callout_option/callout, atom/target)
return TRUE

/**
Expand Down
4 changes: 2 additions & 2 deletions code/datums/components/pet_commands/pet_commands_basic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@
. = ..()
set_command_target(parent, victim)

/datum/pet_command/protect_owner/valid_callout_target(mob/living/caller, datum/callout_option/callout, atom/target)
return target == caller || get_dist(caller, target) <= 1
/datum/pet_command/protect_owner/valid_callout_target(mob/living/speaker, datum/callout_option/callout, atom/target)
return target == speaker || get_dist(speaker, target) <= 1

/datum/pet_command/protect_owner/proc/set_attacking_target(atom/source, mob/living/attacker)
SIGNAL_HANDLER
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/plumbing/_plumbing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
tile_covered = should_hide
parent_obj.update_appearance()

/datum/component/plumbing/proc/change_ducting_layer(obj/caller, obj/changer, new_layer = DUCT_LAYER_DEFAULT)
/datum/component/plumbing/proc/change_ducting_layer(obj/source, obj/changer, new_layer = DUCT_LAYER_DEFAULT)
SIGNAL_HANDLER
ducting_layer = new_layer

Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/plumbing/simple_components.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
demand_connects = NORTH
supply_connects = SOUTH

/datum/component/plumbing/manifold/change_ducting_layer(obj/caller, obj/changer, new_layer)
/datum/component/plumbing/manifold/change_ducting_layer(obj/source, obj/changer, new_layer)
return
6 changes: 3 additions & 3 deletions code/datums/holocall.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
///calls from a head of staff autoconnect, if the receiving pad is not secure.
var/head_call = FALSE

//creates a holocall made by `caller` from `calling_pad` to `callees`
/datum/holocall/New(mob/living/caller, obj/machinery/holopad/calling_pad, list/callees, elevated_access = FALSE)
//creates a holocall made by `call_source` from `calling_pad` to `callees`
/datum/holocall/New(mob/living/call_source, obj/machinery/holopad/calling_pad, list/callees, elevated_access = FALSE)
call_start_time = world.time
user = caller
user = call_source
calling_pad.outgoing_call = src
calling_holopad = calling_pad
head_call = elevated_access
Expand Down
16 changes: 8 additions & 8 deletions code/game/machinery/dna_infuser/infuser_actions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,24 @@
// We do this in InterceptClickOn() instead of Activate()
// because we use the click parameters for aiming the projectile
// (or something like that)
/datum/action/cooldown/ink_spit/InterceptClickOn(mob/living/caller, params, atom/target)
/datum/action/cooldown/ink_spit/InterceptClickOn(mob/living/clicker, params, atom/target)
if(!LAZYACCESS(params2list(params), RIGHT_CLICK))
return
. = ..()
if(!.)
return

var/modifiers = params2list(params)
caller.visible_message(
span_danger("[caller] spits ink!"),
clicker.visible_message(
span_danger("[clicker] spits ink!"),
span_bold("You spit ink."),
)
var/obj/projectile/ink_spit/ink = new /obj/projectile/ink_spit(caller.loc)
ink.aim_projectile(target, caller, modifiers)
ink.firer = caller
var/obj/projectile/ink_spit/ink = new /obj/projectile/ink_spit(clicker.loc)
ink.aim_projectile(target, clicker, modifiers)
ink.firer = clicker
ink.fire()
playsound(caller, 'sound/items/weapons/pierce.ogg', 20, TRUE, -1)
caller.newtonian_move(get_angle(target, caller))
playsound(clicker, 'sound/items/weapons/pierce.ogg', 20, TRUE, -1)
clicker.newtonian_move(get_angle(target, clicker))
StartCooldown()
return TRUE

Expand Down
6 changes: 3 additions & 3 deletions code/game/machinery/hologram.dm
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,9 @@ Possible to do for anyone motivated enough:
for(var/I in holo_calls)
var/datum/holocall/HC = I
var/list/call_data = list(
caller = HC.user,
connected = HC.connected_holopad == src ? TRUE : FALSE,
ref = REF(HC)
"caller" = HC.user,
"connected" = HC.connected_holopad == src ? TRUE : FALSE,
"ref" = REF(HC)
)
data["holo_calls"] += list(call_data)
return data
Expand Down
6 changes: 3 additions & 3 deletions code/game/machinery/porta_turret/portable_turret.dm
Original file line number Diff line number Diff line change
Expand Up @@ -730,13 +730,13 @@ DEFINE_BITFIELD(turret_flags, list(
remote_controller = null
return TRUE

/obj/machinery/porta_turret/proc/InterceptClickOn(mob/living/caller, params, atom/A)
/obj/machinery/porta_turret/proc/InterceptClickOn(mob/living/clicker, params, atom/A)
if(!manual_control)
return FALSE
if(!can_interact(caller))
if(!can_interact(clicker))
remove_control()
return FALSE
log_combat(caller,A,"fired with manual turret control at")
log_combat(clicker, A, "fired with manual turret control at")
target(A)
return TRUE

Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/open/openspace.dm
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
return FALSE

/turf/open/openspace/CanAStarPass(to_dir, datum/can_pass_info/pass_info)
var/atom/movable/our_movable = pass_info.caller_ref.resolve()
var/atom/movable/our_movable = pass_info.requester_ref.resolve()
if(our_movable && !our_movable.can_z_move(DOWN, src, null, ZMOVE_FALL_FLAGS)) //If we can't fall here (flying/lattice), it's fine to path through
return TRUE
return FALSE
Expand Down
6 changes: 3 additions & 3 deletions code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -735,16 +735,16 @@ GLOBAL_LIST_EMPTY(station_turfs)
* Returns adjacent turfs to this turf that are reachable, in all cardinal directions
*
* Arguments:
* * caller: The movable, if one exists, being used for mobility checks to see what tiles it can reach
* * requester: The movable, if one exists, being used for mobility checks to see what tiles it can reach
* * access: A list that decides if we can gain access to doors that would otherwise block a turf
* * simulated_only: Do we only worry about turfs with simulated atmos, most notably things that aren't space?
* * no_id: When true, doors with public access will count as impassible
*/
/turf/proc/reachableAdjacentTurfs(atom/movable/caller, list/access, simulated_only, no_id = FALSE)
/turf/proc/reachableAdjacentTurfs(atom/movable/requester, list/access, simulated_only, no_id = FALSE)
var/static/space_type_cache = typecacheof(/turf/open/space)
. = list()

var/datum/can_pass_info/pass_info = new(caller, access, no_id)
var/datum/can_pass_info/pass_info = new(requester, access, no_id)
for(var/iter_dir in GLOB.cardinals)
var/turf/turf_to_check = get_step(src,iter_dir)
if(!turf_to_check || (simulated_only && space_type_cache[turf_to_check.type]))
Expand Down
14 changes: 7 additions & 7 deletions code/modules/antagonists/cult/blood_magic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,12 @@
enable_text = span_cult("You prepare to horrify a target...")
disable_text = span_cult("You dispel the magic...")

/datum/action/innate/cult/blood_spell/horror/InterceptClickOn(mob/living/caller, params, atom/clicked_on)
var/turf/caller_turf = get_turf(caller)
/datum/action/innate/cult/blood_spell/horror/InterceptClickOn(mob/living/clicker, params, atom/clicked_on)
var/turf/caller_turf = get_turf(clicker)
if(!isturf(caller_turf))
return FALSE

if(!ishuman(clicked_on) || get_dist(caller, clicked_on) > 7)
if(!ishuman(clicked_on) || get_dist(clicker, clicked_on) > 7)
return FALSE

var/mob/living/carbon/human/human_clicked = clicked_on
Expand All @@ -257,24 +257,24 @@

return ..()

/datum/action/innate/cult/blood_spell/horror/do_ability(mob/living/caller, mob/living/carbon/human/clicked_on)
/datum/action/innate/cult/blood_spell/horror/do_ability(mob/living/clicker, mob/living/carbon/human/clicked_on)

clicked_on.set_hallucinations_if_lower(240 SECONDS)
SEND_SOUND(caller, sound('sound/effects/ghost.ogg', FALSE, TRUE, 50))
SEND_SOUND(clicker, sound('sound/effects/ghost.ogg', FALSE, TRUE, 50))

var/image/sparkle_image = image('icons/effects/cult.dmi', clicked_on, "bloodsparkles", ABOVE_MOB_LAYER)
clicked_on.add_alt_appearance(/datum/atom_hud/alternate_appearance/basic/has_antagonist/cult, "cult_apoc", sparkle_image, NONE)

addtimer(CALLBACK(clicked_on, TYPE_PROC_REF(/atom/, remove_alt_appearance), "cult_apoc", TRUE), 4 MINUTES, TIMER_OVERRIDE|TIMER_UNIQUE)
to_chat(caller, span_cult_bold("[clicked_on] has been cursed with living nightmares!"))
to_chat(clicker, span_cult_bold("[clicked_on] has been cursed with living nightmares!"))

charges--
desc = base_desc
desc += "<br><b><u>Has [charges] use\s remaining</u></b>."
build_all_button_icons()
SSblackbox.record_feedback("tally", "cult_spell_invoke", 1, "[name]")
if(charges <= 0)
to_chat(caller, span_cult("You have exhausted the spell's power!"))
to_chat(clicker, span_cult("You have exhausted the spell's power!"))
qdel(src)

return TRUE
Expand Down
Loading

0 comments on commit 91719a4

Please sign in to comment.