From d53f86dbba5845644550f7c8d5926788e508ce77 Mon Sep 17 00:00:00 2001 From: Sierra Helper <125094432+SierraHelper@users.noreply.github.com> Date: Tue, 26 Nov 2024 18:36:39 +0300 Subject: [PATCH] [MIRROR] bump param 2 is "called" for clarity, applied to overrides & uses (#2864) Co-authored-by: Spookerton <918997+Spookerton@users.noreply.github.com> Co-authored-by: Lexanx <61974560+Lexanx@users.noreply.github.com> --- code/game/atoms.dm | 2 +- code/game/atoms_movable.dm | 13 +++++++------ code/game/gamemodes/cult/narsie.dm | 2 +- code/game/gamemodes/meteor/meteors.dm | 2 +- code/game/objects/effects/chem/water.dm | 2 +- code/game/objects/effects/spiders.dm | 2 +- .../structures/stool_bed_chair_nest/chairs.dm | 4 ++-- .../structures/stool_bed_chair_nest/wheelchair.dm | 4 ++-- code/game/turfs/turf.dm | 10 +++++----- code/modules/ZAS/Airflow.dm | 2 +- .../integrated_electronics/core/assemblies.dm | 2 +- code/modules/mob/living/bot/bot.dm | 2 +- code/modules/mob/living/bot/mulebot.dm | 2 +- .../carbon/alien/diona/gestalt/gestalt_movement.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 4 ++-- .../living/carbon/xenobiological/xenobiological.dm | 4 ++-- code/modules/mob/living/living.dm | 4 ++-- code/modules/overmap/ships/ship.dm | 2 +- .../singularity/particle_accelerator/particle.dm | 4 ++-- code/modules/power/singularity/singularity.dm | 2 +- code/modules/projectiles/projectile.dm | 8 ++++---- code/modules/projectiles/projectile/animate.dm | 2 +- code/modules/projectiles/projectile/bullets.dm | 2 +- code/modules/projectiles/projectile/special.dm | 2 +- code/modules/spells/aoe_turf/drain_blood.dm | 2 +- code/modules/spells/spell_projectile.dm | 2 +- code/modules/xenoarcheaology/artifacts/gigadrill.dm | 2 +- code/modules/xenoarcheaology/finds/special.dm | 2 +- 28 files changed, 47 insertions(+), 46 deletions(-) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 12d9d2a471980..65f98efabc7ab 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -240,7 +240,7 @@ * - `mover` - The atom that's attempting to move. * - `target` - The detination turf `mover` is attempting to move to. * - * Returns boolean. If `FALSE`, blocks movement and calls `mover.Bump(src)`. + * Returns boolean. If `FALSE`, blocks movement and calls `mover.Bump(src, TRUE)`. */ /atom/proc/CheckExit(atom/movable/mover, turf/target) return TRUE diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 5457e30086b71..2f3a174553695 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -159,18 +159,19 @@ particles = null return ..() -/atom/movable/Bump(atom/A, yes) - if(!QDELETED(throwing)) - throwing.hit_atom(A) - if(inertia_dir) +/// Called should be true when calling this in code. +/atom/movable/Bump(atom/A, called) + if (!QDELETED(throwing)) + throwing.hit_atom(A) + if (inertia_dir) inertia_dir = 0 - - if (A && yes) + if (A && called) A.last_bumped = world.time invoke_async(A, TYPE_PROC_REF(/atom, Bumped), src) // Avoids bad actors sleeping or unexpected side effects, as the legacy behavior was to spawn here ..() + /atom/movable/proc/forceMove(atom/destination) if((gc_destroyed && gc_destroyed != GC_CURRENTLY_BEING_QDELETED) && !isnull(destination)) CRASH("Attempted to forceMove a QDELETED [src] out of nullspace!!!") diff --git a/code/game/gamemodes/cult/narsie.dm b/code/game/gamemodes/cult/narsie.dm index 9aca1b754f9f1..fdb0c0a447a77 100644 --- a/code/game/gamemodes/cult/narsie.dm +++ b/code/game/gamemodes/cult/narsie.dm @@ -83,7 +83,7 @@ var/global/list/narsie_list = list() M.apply_effect(3, EFFECT_STUN) -/obj/singularity/narsie/large/Bump(atom/A) +/obj/singularity/narsie/large/Bump(atom/A, called) if(!cause_hell) return if(isturf(A)) narsiewall(A) diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm index 4ceae7a29cf1f..0fb8a16f583af 100644 --- a/code/game/gamemodes/meteor/meteors.dm +++ b/code/game/gamemodes/meteor/meteors.dm @@ -176,7 +176,7 @@ var/global/list/meteors_cataclysm = list(\ if (!ismissile) SpinAnimation() -/obj/meteor/Bump(atom/A) +/obj/meteor/Bump(atom/A, called) ..() if(A && !QDELETED(src)) // Prevents explosions and other effects when we were deleted by whatever we Bumped() - currently used by shields. ram_turf(get_turf(A)) diff --git a/code/game/objects/effects/chem/water.dm b/code/game/objects/effects/chem/water.dm index ce88e14aa127a..d0700f8f01f92 100644 --- a/code/game/objects/effects/chem/water.dm +++ b/code/game/objects/effects/chem/water.dm @@ -52,7 +52,7 @@ return 0 . = ..() -/obj/effect/water/Bump(atom/A) +/obj/effect/water/Bump(atom/A, called) if(reagents) reagents.touch(A) return ..() diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 640bc38f1e375..d0663f1930023 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -171,7 +171,7 @@ GLOB.moved_event.unregister(src, src, TYPE_PROC_REF(/obj/spider/spiderling, disturbed)) START_PROCESSING(SSobj, src) -/obj/spider/spiderling/Bump(atom/user) +/obj/spider/spiderling/Bump(atom/user, called) if(istype(user, /obj/structure/table)) forceMove(user.loc) else diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index a6e62e0d104ae..0edf2acec6c0e 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -241,11 +241,11 @@ if (propelled) for (var/mob/O in src.loc) if (O != occupant) - Bump(O) + Bump(O, TRUE) else unbuckle_mob() -/obj/structure/bed/chair/office/Bump(atom/A) +/obj/structure/bed/chair/office/Bump(atom/A, called) ..() if(!buckled_mob) return diff --git a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm index d27373bee9033..9d336cc238c56 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm @@ -102,7 +102,7 @@ if (propelled) for (var/mob/O in src.loc) if (O != occupant) - Bump(O) + Bump(O, TRUE) else unbuckle_mob() if (pulling && (get_dist(src, pulling) > 1)) @@ -141,7 +141,7 @@ return TRUE return FALSE -/obj/structure/bed/chair/wheelchair/Bump(atom/A) +/obj/structure/bed/chair/wheelchair/Bump(atom/A, called) ..() if(!buckled_mob) return diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 7a52bbe2e3a24..89a3c8b32809f 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -164,33 +164,33 @@ for(var/obj/obstacle in mover.loc) if(!(obstacle.atom_flags & ATOM_FLAG_CHECKS_BORDER) && (mover != obstacle) && (forget != obstacle)) if(!obstacle.CheckExit(mover, src)) - mover.Bump(obstacle, 1) + mover.Bump(obstacle, TRUE) return 0 //Now, check objects to block exit that are on the border for(var/obj/border_obstacle in mover.loc) if((border_obstacle.atom_flags & ATOM_FLAG_CHECKS_BORDER) && (mover != border_obstacle) && (forget != border_obstacle)) if(!border_obstacle.CheckExit(mover, src)) - mover.Bump(border_obstacle, 1) + mover.Bump(border_obstacle, TRUE) return 0 //Next, check objects to block entry that are on the border for(var/obj/border_obstacle in src) if(border_obstacle.atom_flags & ATOM_FLAG_CHECKS_BORDER) if(!border_obstacle.CanPass(mover, mover.loc, 1, 0) && (forget != border_obstacle)) - mover.Bump(border_obstacle, 1) + mover.Bump(border_obstacle, TRUE) return 0 //Then, check the turf itself if (!src.CanPass(mover, src)) - mover.Bump(src, 1) + mover.Bump(src, TRUE) return 0 //Finally, check objects/mobs to block entry that are not on the border for(var/atom/movable/obstacle in src) if(!(obstacle.atom_flags & ATOM_FLAG_CHECKS_BORDER)) if(!obstacle.CanPass(mover, mover.loc, 1, 0) && (forget != obstacle)) - mover.Bump(obstacle, 1) + mover.Bump(obstacle, TRUE) return 0 return 1 //Nothing found to block so return success! diff --git a/code/modules/ZAS/Airflow.dm b/code/modules/ZAS/Airflow.dm index 720dddb13469c..8a6e24db9d51e 100644 --- a/code/modules/ZAS/Airflow.dm +++ b/code/modules/ZAS/Airflow.dm @@ -85,7 +85,7 @@ Contains helper procs for airflow, handled in /connection_group. return 0 return 1 -/atom/movable/Bump(atom/A) +/atom/movable/Bump(atom/A, called) if(airflow_speed > 0 && airflow_dest) if(airborne_acceleration > 1) airflow_hit(A) diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm index 1c633cf218458..2631feb973993 100644 --- a/code/modules/integrated_electronics/core/assemblies.dm +++ b/code/modules/integrated_electronics/core/assemblies.dm @@ -100,7 +100,7 @@ var/o_access = O.GetAccess() . |= o_access -/obj/item/device/electronic_assembly/Bump(atom/AM) +/obj/item/device/electronic_assembly/Bump(atom/AM, called) collw = weakref(AM) .=..() if(istype(AM, /obj/machinery/door/airlock) || istype(AM, /obj/machinery/door/window)) diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index db1b5005b48c9..ba8896392b2fc 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -227,7 +227,7 @@ ..(message, null, verb) -/mob/living/bot/Bump(atom/A) +/mob/living/bot/Bump(atom/A, called) if(on && botcard && istype(A, /obj/machinery/door)) var/obj/machinery/door/D = A if(!istype(D, /obj/machinery/door/firedoor) && !istype(D, /obj/machinery/door/blast) && D.check_access(botcard)) diff --git a/code/modules/mob/living/bot/mulebot.dm b/code/modules/mob/living/bot/mulebot.dm index 6f6f7ed6c0bba..0ab3a2f057f01 100644 --- a/code/modules/mob/living/bot/mulebot.dm +++ b/code/modules/mob/living/bot/mulebot.dm @@ -203,7 +203,7 @@ if(T == src.loc) unload(dir) -/mob/living/bot/mulebot/Bump(mob/living/carbon/human/M) +/mob/living/bot/mulebot/Bump(mob/living/carbon/human/M, called) if(!safety && istype(M)) visible_message(SPAN_WARNING("[src] knocks over [M]!")) M.Stun(8) diff --git a/code/modules/mob/living/carbon/alien/diona/gestalt/gestalt_movement.dm b/code/modules/mob/living/carbon/alien/diona/gestalt/gestalt_movement.dm index 3299fc29e01b1..13882e7b14115 100644 --- a/code/modules/mob/living/carbon/alien/diona/gestalt/gestalt_movement.dm +++ b/code/modules/mob/living/carbon/alien/diona/gestalt/gestalt_movement.dm @@ -2,7 +2,7 @@ if(nymphs[user]) step(src, direction) // ANARCHY! DEMOCRACY! ANARCHY! DEMOCRACY! // Naaaa na na na na naa naa https://www.youtube.com/watch?v=iMH49ieL4es -/obj/structure/diona_gestalt/Bump(atom/movable/AM, yes) // what a useful argname, thanks oldcoders +/obj/structure/diona_gestalt/Bump(atom/movable/AM, called) . = ..() if(AM && can_roll_up_atom(AM) && AM.Adjacent(src)) var/turf/stepping = AM.loc diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index df6b1a53cfcfa..5c7856226f33d 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -383,8 +383,8 @@ if(alert("Are you sure you want to [player_triggered_sleeping ? "wake up?" : "sleep for a while? Use 'sleep' again to wake up"]", "Sleep", "No", "Yes") == "Yes") player_triggered_sleeping = !player_triggered_sleeping -/mob/living/carbon/Bump(atom/movable/AM, yes) - if(now_pushing || !yes) +/mob/living/carbon/Bump(atom/movable/AM, called) + if(now_pushing || !called) return ..() //[SIERRA-ADD] VIRUSOLOGY diff --git a/code/modules/mob/living/carbon/xenobiological/xenobiological.dm b/code/modules/mob/living/carbon/xenobiological/xenobiological.dm index 6ac95c42b74ba..7238c133e2e90 100644 --- a/code/modules/mob/living/carbon/xenobiological/xenobiological.dm +++ b/code/modules/mob/living/carbon/xenobiological/xenobiological.dm @@ -117,8 +117,8 @@ return tally -/mob/living/carbon/slime/Bump(atom/movable/AM as mob|obj, yes) - if ((!(yes) || now_pushing)) +/mob/living/carbon/slime/Bump(atom/movable/AM, called) + if ((!(called) || now_pushing)) return now_pushing = 1 diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 1d18fb3537547..1afbb67ef3a36 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -64,7 +64,7 @@ default behaviour is: return 0 return ..() -/mob/living/Bump(atom/movable/AM, yes) +/mob/living/Bump(atom/movable/AM, called) // This is boilerplate from /atom/movable/Bump() but in all honest // I have no clue what is going on in the logic below this and I'm @@ -75,7 +75,7 @@ default behaviour is: // End boilerplate. spawn(0) - if ((!( yes ) || now_pushing) || !loc) + if ((!( called ) || now_pushing) || !loc) return now_pushing = 1 diff --git a/code/modules/overmap/ships/ship.dm b/code/modules/overmap/ships/ship.dm index cfbff879e87e9..bfddc184af1f3 100644 --- a/code/modules/overmap/ships/ship.dm +++ b/code/modules/overmap/ships/ship.dm @@ -268,7 +268,7 @@ var/global/const/OVERMAP_SPEED_CONSTANT = (1 SECOND) if(!SSshuttle.overmap_halted) halted = 0 -/obj/overmap/visitable/ship/Bump(atom/A) +/obj/overmap/visitable/ship/Bump(atom/A, called) if(istype(A,/turf/unsimulated/map/edge)) handle_wraparound() ..() diff --git a/code/modules/power/singularity/particle_accelerator/particle.dm b/code/modules/power/singularity/particle_accelerator/particle.dm index 3b6fd319d0703..5a77e0371848e 100644 --- a/code/modules/power/singularity/particle_accelerator/particle.dm +++ b/code/modules/power/singularity/particle_accelerator/particle.dm @@ -23,7 +23,7 @@ active = TRUE move(1) -/obj/accelerated_particle/Bump(atom/A) +/obj/accelerated_particle/Bump(atom/A, called) if (!active) return if (A) @@ -50,7 +50,7 @@ if (!active) return if(ismob(A)) - Bump(A) + Bump(A, TRUE) /obj/accelerated_particle/ex_act(severity) if (!active) diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index 9fd15cca03bc3..e714e91611f01 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -70,7 +70,7 @@ /obj/singularity/bullet_act(obj/item/projectile/P) return 0 //Will there be an impact? Who knows. Will we see it? No. -/obj/singularity/Bump(atom/A) +/obj/singularity/Bump(atom/A, called) consume(A) /obj/singularity/Bumped(atom/A) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 4fabeb561a7f0..7d77c7852a038 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -295,13 +295,13 @@ return 1 -/obj/item/projectile/Bump(atom/atom, forced) +/obj/item/projectile/Bump(atom/atom, called) if (atom == src) return FALSE if (atom == firer) forceMove(atom.loc) return FALSE - if (bumped && !forced || (atom in permutated)) + if (bumped && !called || (atom in permutated)) return FALSE bumped = TRUE var/passthrough @@ -377,7 +377,7 @@ if(!bumped && !isturf(original)) if(loc == get_turf(original)) if(!(original in permutated)) - if(Bump(original)) + if(Bump(original, TRUE)) return if(first_step) @@ -458,7 +458,7 @@ var/result = 0 //To pass the message back to the gun. var/atom/hit_thing -/obj/item/projectile/test/Bump(atom/A as mob|obj|turf|area, forced=0) +/obj/item/projectile/test/Bump(atom/A, called) if(A == firer) forceMove(A.loc) return //cannot shoot yourself diff --git a/code/modules/projectiles/projectile/animate.dm b/code/modules/projectiles/projectile/animate.dm index d4da278085574..6fd68ae597031 100644 --- a/code/modules/projectiles/projectile/animate.dm +++ b/code/modules/projectiles/projectile/animate.dm @@ -6,7 +6,7 @@ nodamage = TRUE damage_flags = 0 -/obj/item/projectile/animate/Bump(atom/change, forced=0) +/obj/item/projectile/animate/Bump(atom/change, called) if((istype(change, /obj/item) || istype(change, /obj/structure)) && !is_type_in_list(change, GLOB.mimic_protected)) var/obj/O = change new /mob/living/simple_animal/hostile/mimic/(O.loc, O, firer) diff --git a/code/modules/projectiles/projectile/bullets.dm b/code/modules/projectiles/projectile/bullets.dm index 8642989a60cea..0d5b4c6d015c4 100644 --- a/code/modules/projectiles/projectile/bullets.dm +++ b/code/modules/projectiles/projectile/bullets.dm @@ -119,7 +119,7 @@ if(. && !base_spread && isturf(loc)) for(var/mob/living/M in loc) if(M.lying || !M.CanPass(src, loc, 0.5, 0)) //Bump if lying or if we would normally Bump. - if(Bump(M)) //Bump will make sure we don't hit a mob multiple times + if(Bump(M, TRUE)) //Bump will make sure we don't hit a mob multiple times return /* short-casing projectiles, like the kind used in pistols or SMGs */ diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm index 536d227903052..6fa03c8ec40b5 100644 --- a/code/modules/projectiles/projectile/special.dm +++ b/code/modules/projectiles/projectile/special.dm @@ -40,7 +40,7 @@ damage_type = DAMAGE_BRUTE nodamage = TRUE -/obj/item/projectile/meteor/Bump(atom/A as mob|obj|turf|area, forced=0) +/obj/item/projectile/meteor/Bump(atom/A, called) if(A == firer) forceMove(A.loc) return diff --git a/code/modules/spells/aoe_turf/drain_blood.dm b/code/modules/spells/aoe_turf/drain_blood.dm index 43d162a9936f9..8dfa3a535ac42 100644 --- a/code/modules/spells/aoe_turf/drain_blood.dm +++ b/code/modules/spells/aoe_turf/drain_blood.dm @@ -54,7 +54,7 @@ tracer_type = /obj/projectile/blood impact_type = /obj/projectile/blood -/obj/item/projectile/beam/blood_effect/Bump(atom/a, forced=0) +/obj/item/projectile/beam/blood_effect/Bump(atom/a, called) if(a == original) on_impact(a) qdel(src) diff --git a/code/modules/spells/spell_projectile.dm b/code/modules/spells/spell_projectile.dm index 484fdf934013f..7c2c6fc83b104 100644 --- a/code/modules/spells/spell_projectile.dm +++ b/code/modules/spells/spell_projectile.dm @@ -41,7 +41,7 @@ qdel(src) return -/obj/item/projectile/spell_projectile/Bump(atom/A, forced=0) +/obj/item/projectile/spell_projectile/Bump(atom/A, called) if(loc && carried) prox_cast(carried.choose_prox_targets(user = carried.holder, spell_holder = src)) return 1 diff --git a/code/modules/xenoarcheaology/artifacts/gigadrill.dm b/code/modules/xenoarcheaology/artifacts/gigadrill.dm index e7eef65394fd2..017385bbe2584 100644 --- a/code/modules/xenoarcheaology/artifacts/gigadrill.dm +++ b/code/modules/xenoarcheaology/artifacts/gigadrill.dm @@ -20,7 +20,7 @@ to_chat(user, SPAN_NOTICE("You press a button and \the [src] shudders to life.")) return TRUE -/obj/machinery/giga_drill/Bump(atom/A) +/obj/machinery/giga_drill/Bump(atom/A, called) if(active && !drilling_turf) if(istype(A,/turf/simulated/mineral)) var/turf/simulated/mineral/M = A diff --git a/code/modules/xenoarcheaology/finds/special.dm b/code/modules/xenoarcheaology/finds/special.dm index b3a02a54bf2f5..5379a21981a1e 100644 --- a/code/modules/xenoarcheaology/finds/special.dm +++ b/code/modules/xenoarcheaology/finds/special.dm @@ -221,5 +221,5 @@ else STOP_PROCESSING(SSobj, src) -/obj/shadow_wight/Bump(atom/obstacle) +/obj/shadow_wight/Bump(atom/obstacle, called) to_chat(obstacle, SPAN_WARNING("You feel a chill run down your spine!"))