Skip to content

Commit

Permalink
Swaps param order for grab_attack().
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Sep 21, 2024
1 parent 2ac3bb2 commit aa8af43
Show file tree
Hide file tree
Showing 27 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@
- `G`: The grab hitting this atom
- Return: `TRUE` to skip attackby() and afterattack() or `FALSE`
*/
/atom/proc/grab_attack(mob/user, obj/item/grab/grab)
/atom/proc/grab_attack(obj/item/grab/grab, mob/user)
return FALSE

/atom/proc/climb_on()
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/OpTable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
. = ..()
to_chat(user, SPAN_NOTICE("The neural suppressors are switched [suppressing ? "on" : "off"]."))

/obj/machinery/optable/grab_attack(mob/user, obj/item/grab/grab)
/obj/machinery/optable/grab_attack(obj/item/grab/grab, mob/user)
if(isliving(grab.affecting) && check_table(grab.affecting))
take_victim(grab.affecting, user)
qdel(grab)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/bodyscanner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
if(istype(new_state))
updateUsrDialog()

/obj/machinery/bodyscanner/grab_attack(mob/user, obj/item/grab/grab)
/obj/machinery/bodyscanner/grab_attack(obj/item/grab/grab, mob/user)
var/mob/living/victim = grab.get_affecting_mob()
if(istype(victim) && user_can_move_target_inside(victim, user))
qdel(grab)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/cryopod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@
attempt_enter(dropping, user)
return TRUE

/obj/machinery/cryopod/grab_attack(mob/user, obj/item/grab/grab)
/obj/machinery/cryopod/grab_attack(obj/item/grab/grab, mob/user)
var/mob/living/victim = grab.get_affecting_mob()
if(istype(victim) && istype(user))
if(occupant)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/kitchen/cooking_machines/_cooker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
return SPAN_NOTICE("Wait for \the [src] to finish first!")
return ..()

/obj/machinery/cooker/grab_attack(mob/user, obj/item/grab/grab)
/obj/machinery/cooker/grab_attack(obj/item/grab/grab, mob/user)
// We are trying to cook a grabbed mob.
var/mob/living/victim = grab.get_affecting_mob()
if(!istype(victim))
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/kitchen/gibber.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
return SPAN_NOTICE("You must wait for \the [src] to finish operating first!")
return ..()

/obj/machinery/gibber/grab_attack(mob/user, obj/item/grab/grab)
/obj/machinery/gibber/grab_attack(obj/item/grab/grab, mob/user)
if(grab.force_danger())
move_into_gibber(user, grab.affecting)
qdel(grab)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/kitchen/microwave.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
* Item Adding
********************/

/obj/machinery/microwave/grab_attack(mob/user, obj/item/grab/grab)
/obj/machinery/microwave/grab_attack(obj/item/grab/grab, mob/user)
to_chat(user, SPAN_WARNING("This is ridiculous. You can not fit \the [grab.affecting] into \the [src]."))
return TRUE

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/suit_cycler.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
return TRUE
return FALSE

/obj/machinery/suit_cycler/grab_attack(mob/user, obj/item/grab/grab)
/obj/machinery/suit_cycler/grab_attack(obj/item/grab/grab, mob/user)
var/mob/living/victim = grab.get_affecting_mob()
if(istype(victim) && try_move_inside(victim, user))
qdel(grab)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/effects/chem/foam.dm
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
return TRUE


/obj/structure/foamedmetal/grab_attack(mob/user, obj/item/grab/grab)
/obj/structure/foamedmetal/grab_attack(obj/item/grab/grab, mob/user)
grab.affecting.forceMove(loc)
visible_message(SPAN_DANGER("\The [user] smashes \the [grab.affecting] through the foamed metal wall!"))
qdel(grab)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/implants/implantchair.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
src.updateUsrDialog()
src.add_fingerprint(usr)

/obj/machinery/implantchair/grab_attack(mob/user, obj/item/grab/grab)
/obj/machinery/implantchair/grab_attack(obj/item/grab/grab, mob/user)
var/mob/living/victim = grab.get_affecting_mob()
if(istype(victim) && victim.can_enter_cryopod(user) && put_mob(victim))
qdel(grab)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/__structure.dm
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
AM.reset_offsets()
AM.reset_plane_and_layer()

/obj/structure/grab_attack(mob/user, obj/item/grab/grab)
/obj/structure/grab_attack(obj/item/grab/grab, mob/user)

if (!grab.force_danger())
to_chat(user, SPAN_WARNING("You need a better grip to do that!"))
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/catwalk.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
if(!QDELETED(src) && severity != 3)
physically_destroyed()

/obj/structure/catwalk/grab_attack(mob/user, obj/item/grab/grab)
/obj/structure/catwalk/grab_attack(obj/item/grab/grab, mob/user)
if(atom_flags & ATOM_FLAG_CLIMBABLE)
var/obj/occupied = turf_is_crowded()
if (occupied)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ var/global/list/closets = list()
take_damage(proj_damage, Proj.atom_damage_type)

// Override this so the logic in attackby() can run.
/obj/structure/closet/grab_attack(mob/user, obj/item/grab/grab)
/obj/structure/closet/grab_attack(obj/item/grab/grab, mob/user)
return FALSE

/obj/structure/closet/attackby(obj/item/used_item, mob/user)
Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/structures/fires.dm
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@

return ..()

/obj/structure/fire_source/grab_attack(mob/user, obj/item/grab/grab)
/obj/structure/fire_source/grab_attack(obj/item/grab/grab, mob/user)
var/mob/living/victim = grab.get_affecting_mob()
if(!istype(victim))
return FALSE
Expand Down Expand Up @@ -528,7 +528,7 @@
color = /decl/material/solid/metal/iron::color
obj_flags = OBJ_FLAG_HOLLOW

/obj/structure/fire_source/stove/grab_attack(mob/user, obj/item/grab/grab)
/obj/structure/fire_source/stove/grab_attack(obj/item/grab/grab, mob/user)
return FALSE

/obj/structure/fire_source/fireplace
Expand All @@ -545,7 +545,7 @@
light_color_mid = "#d47b27"
light_color_low = "#e44141"

/obj/structure/fire_source/fireplace/grab_attack(mob/user, obj/item/grab/grab)
/obj/structure/fire_source/fireplace/grab_attack(obj/item/grab/grab, mob/user)
return FALSE

#define MATERIAL_FIREPLACE(material_name) \
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/hand_cart.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
carrying.forceMove(get_turf(src))
carrying = null

/obj/structure/hand_cart/grab_attack(mob/user, obj/item/grab/grab)
/obj/structure/hand_cart/grab_attack(obj/item/grab/grab, mob/user)
if(isobj(grab.affecting))
to_chat(user, SPAN_NOTICE("You start loading \the [grab.affecting] onto \the [src]."))
if(load_item(grab.affecting, user))
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/mineral_bath.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
venus.adjust_multi(/decl/material/gas/chlorine, MOLES_N2STANDARD, /decl/material/gas/hydrogen, MOLES_O2STANDARD)
return venus

/obj/structure/mineral_bath/grab_attack(mob/user, obj/item/grab/grab)
/obj/structure/mineral_bath/grab_attack(obj/item/grab/grab, mob/user)
if(enter_bath(grab.affecting))
qdel(grab)
return TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/railing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ WOOD_RAILING_SUBTYPE(yew)
return 0
return 1

/obj/structure/railing/grab_attack(mob/user, obj/item/grab/grab)
/obj/structure/railing/grab_attack(obj/item/grab/grab, mob/user)
var/mob/living/victim = grab.get_affecting_mob()
if(!istype(victim) || !istype(user))
return ..()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
remove_padding()
return TRUE

/obj/structure/bed/grab_attack(mob/user, obj/item/grab/grab)
/obj/structure/bed/grab_attack(obj/item/grab/grab, mob/user)
var/mob/living/victim = grab.get_affecting_mob()
if(istype(victim) && istype(user))
user.visible_message(SPAN_NOTICE("\The [user] attempts to put \the [victim] onto \the [src]!"))
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/structures/watercloset.dm
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ var/global/list/hygiene_props = list()
..()
icon_state = "toilet[open][cistern]"

/obj/structure/hygiene/toilet/grab_attack(mob/user, obj/item/grab/grab)
/obj/structure/hygiene/toilet/grab_attack(obj/item/grab/grab, mob/user)
var/mob/living/victim = grab.get_affecting_mob()
if(istype(victim))
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
Expand Down Expand Up @@ -209,7 +209,7 @@ var/global/list/hygiene_props = list()
directional_offset = @'{"NORTH":{"y":-32}, "SOUTH":{"y":32}, "EAST":{"x":-32}, "WEST":{"x":32}}'
obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED

/obj/structure/hygiene/urinal/grab_attack(mob/user, obj/item/grab/grab)
/obj/structure/hygiene/urinal/grab_attack(obj/item/grab/grab, mob/user)
var/mob/living/victim = grab.get_affecting_mob()
if(istype(victim))
if(!victim.loc == get_turf(src))
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/window.dm
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@
for(var/obj/item/thing in .)
thing.set_color(paint_color)

/obj/structure/window/grab_attack(mob/user, obj/item/grab/grab)
/obj/structure/window/grab_attack(obj/item/grab/grab, mob/user)
if (user.a_intent != I_HURT)
return TRUE
if (!grab.force_danger())
Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
/turf/attack_robot(var/mob/user)
return attack_hand_with_interaction_checks(user)

/turf/grab_attack(mob/user, obj/item/grab/grab)
/turf/grab_attack(obj/item/grab/grab, mob/user)
if (grab.affecting != user)
grab.affecting.DoMove(get_dir(grab.affecting.loc, src), user, TRUE)
return TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/butchery/butchery_hook.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
to_chat(user, SPAN_WARNING("\The [occupant] is so badly mangled that removing them from \the [initial(name)] would be pointless."))
return TRUE

/obj/structure/meat_hook/grab_attack(mob/user, obj/item/grab/grab)
/obj/structure/meat_hook/grab_attack(obj/item/grab/grab, mob/user)
var/mob/victim = grab.get_affecting_mob()
if(istype(victim) && isturf(victim.loc))
try_spike(victim, user)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/grab/grab_object.dm
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
/obj/item/grab/resolve_attackby(atom/A, mob/user, var/click_params)
if(QDELETED(src) || !current_grab || !assailant)
return TRUE
if(A.grab_attack(user, src) || current_grab.hit_with_grab(src, A, get_dist(user, A) <= 1))
if(A.grab_attack(src, user) || current_grab.hit_with_grab(src, A, get_dist(user, A) <= 1))
return TRUE
. = ..()

Expand Down
2 changes: 1 addition & 1 deletion code/modules/multiz/ladder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
return ..()

// Override to allow attackby() flow to function with grabs.
/obj/structure/ladder/grab_attack(mob/user, obj/item/grab/grab)
/obj/structure/ladder/grab_attack(obj/item/grab/grab, mob/user)
return FALSE

/obj/structure/ladder/attackby(obj/item/I, mob/user)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/recycling/conveyor2.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ var/global/list/all_conveyor_switches = list()
if(items_moved >= 10)
break

/obj/machinery/conveyor/grab_attack(mob/user, obj/item/grab/grab)
/obj/machinery/conveyor/grab_attack(obj/item/grab/grab, mob/user)
step(grab.affecting, get_dir(grab.affecting.loc, src))
return TRUE

Expand Down
2 changes: 1 addition & 1 deletion code/modules/recycling/disposal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var/global/list/diversion_junctions = list()
return SPAN_NOTICE("Eject the items first!")
return ..()

/obj/machinery/disposal/grab_attack(mob/user, obj/item/grab/grab)
/obj/machinery/disposal/grab_attack(obj/item/grab/grab, mob/user)
var/mob/living/victim = grab.get_affecting_mob()
if(istype(victim))
user.visible_message(SPAN_DANGER("\The [user] starts putting \the [victim] into the disposal."))
Expand Down
2 changes: 1 addition & 1 deletion mods/gamemodes/deity/structures/altar.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
to_chat(src, SPAN_DANGER("You've lost an altar!"))
return ..()

/obj/structure/deity/altar/grab_attack(mob/user, obj/item/grab/grab)
/obj/structure/deity/altar/grab_attack(obj/item/grab/grab, mob/user)
var/mob/living/victim = grab.get_affecting_mob()
if(grab.force_danger() && istype(victim))
victim.dropInto(loc)
Expand Down

0 comments on commit aa8af43

Please sign in to comment.