diff --git a/code/game/objects/items/melee/misc.dm b/code/game/objects/items/melee/misc.dm
index 3dcf6d36e7..7d4cd2d91d 100644
--- a/code/game/objects/items/melee/misc.dm
+++ b/code/game/objects/items/melee/misc.dm
@@ -296,7 +296,7 @@
if(!iscarbon(user))
target.LAssailant = null
else
- target.LAssailant = user
+ target.LAssailant = WEAKREF(user)
cooldown_check = world.time + cooldown
user.adjustStaminaLossBuffered(getweight())//CIT CHANGE - makes swinging batons cost stamina
else
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index cd448d090f..a2a69cb49a 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -295,7 +295,7 @@
if(!iscarbon(src))
M.LAssailant = null
else
- M.LAssailant = usr
+ M.LAssailant = WEAKREF(usr)
if(isliving(M))
var/mob/living/L = M
//Share diseases that are spread by touch
diff --git a/code/modules/mob/living/simple_animal/slime/life.dm b/code/modules/mob/living/simple_animal/slime/life.dm
index a923da6ed6..4b89d96e64 100644
--- a/code/modules/mob/living/simple_animal/slime/life.dm
+++ b/code/modules/mob/living/simple_animal/slime/life.dm
@@ -186,12 +186,13 @@
if(M.stat == DEAD) // our victim died
if(!client)
if(!rabid && !attacked)
- if(M.LAssailant && M.LAssailant != M)
+ var/mob/living/carbon/their_attacker = M.getLAssailant()
+ if(their_attacker != M)
if(prob(50))
- if(!(M.LAssailant in Friends))
- Friends[M.LAssailant] = 1
+ if(!(their_attacker in Friends))
+ Friends[their_attacker] = 1
else
- ++Friends[M.LAssailant]
+ ++Friends[their_attacker]
else
to_chat(src, "This subject does not have a strong enough life energy anymore...")
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index 8f6957c0c4..e6cdf81e38 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -955,6 +955,9 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0)
. = ..()
update_movespeed(FALSE)
+/mob/proc/getLAssailant()
+ return LAssailant?.resolve()
+
/// Updates the grab state of the mob and updates movespeed
/mob/setGrabState(newstate)
. = ..()
@@ -975,4 +978,4 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0)
/mob/proc/equipped_speed_mods()
for(var/obj/item/I in held_items)
if(I.item_flags & SLOWS_WHILE_IN_HAND)
- . += I.slowdown
\ No newline at end of file
+ . += I.slowdown
diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm
index 638a3aa0e2..6725e29610 100644
--- a/code/modules/mob/mob_defines.dm
+++ b/code/modules/mob/mob_defines.dm
@@ -80,8 +80,8 @@
var/list/faction = list("neutral") //A list of factions that this mob is currently in, for hostile mob targetting, amongst other things
var/move_on_shuttle = 1 // Can move on the shuttle.
-//The last mob/living/carbon to push/drag/grab this mob (mostly used by slimes friend recognition)
- var/mob/living/carbon/LAssailant = null
+ /// The last mob/living/carbon to push/drag/grab this mob (mostly used by slimes friend recognition)
+ var/datum/weakref/LAssailant
var/list/obj/user_movement_hooks //Passes movement in client/Move() to these!
diff --git a/code/modules/recycling/disposal/bin.dm b/code/modules/recycling/disposal/bin.dm
index 38b62546a8..78e18a01e2 100644
--- a/code/modules/recycling/disposal/bin.dm
+++ b/code/modules/recycling/disposal/bin.dm
@@ -137,7 +137,7 @@
else
target.visible_message("[user] has placed [target] in [src].", "[user] has placed [target] in [src].")
log_combat(user, target, "stuffed", addition="into [src]")
- target.LAssailant = user
+ target.LAssailant = WEAKREF(user)
update_icon()
/obj/machinery/disposal/proc/can_stuff_mob_in(mob/living/target, mob/living/user, pushing = FALSE)
diff --git a/code/modules/research/xenobiology/xenobio_camera.dm b/code/modules/research/xenobiology/xenobio_camera.dm
index 9682d404ea..5492e9bc38 100644
--- a/code/modules/research/xenobiology/xenobio_camera.dm
+++ b/code/modules/research/xenobiology/xenobio_camera.dm
@@ -236,7 +236,7 @@
if(X.monkeys >= 1)
var/mob/living/carbon/monkey/food = new /mob/living/carbon/monkey(remote_eye.loc, TRUE, owner)
if (!QDELETED(food))
- food.LAssailant = C
+ food.LAssailant = WEAKREF(C)
X.monkeys --
to_chat(owner, "[X] now has [X.monkeys] monkey(s) left.")
else
@@ -474,7 +474,7 @@
if(X.monkeys >= 1)
var/mob/living/carbon/monkey/food = new /mob/living/carbon/monkey(T, TRUE, C)
if (!QDELETED(food))
- food.LAssailant = C
+ food.LAssailant = WEAKREF(C)
X.monkeys--
X.monkeys = round(X.monkeys, 0.1) //Prevents rounding errors
to_chat(C, "[X] now has [X.monkeys] monkey(s) stored.")