Skip to content

Commit 72b418b

Browse files
authored
Fixes hostile mob's friends list entries getting deleted while in use (#37297)
* Adds a check to ensure that the lastassailant weakref isn't also being used by a hostile mob for its friends list, preventing mobs from forgetting their friends. * Replaces lastassailant weakref deletion with setting to null Fixes bugs caused by the lastassailant weakref getting deleted, which would break any other objects that were using that weakref.
1 parent 4cd86d5 commit 72b418b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

code/__HELPERS/logging.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
if (ismob(target))
9696
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been [what_done] by [user_txt][object_txt].[intent_txt][addition_txt]</font>")
9797
if (!iscarbon(user))
98-
QDEL_NULL(target.lastassailant)
98+
target.lastassailant = null
9999

100100
if (ismob(user) && ismob(target))
101101
target.assaulted_by(user)

code/modules/runescape/runescape_pvp.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ var/list/non_standard_maint_areas = list(
5959

6060
/mob/proc/assaulted_by(var/mob/M,var/weak_assault=FALSE)
6161
if(!iscarbon(M))
62-
QDEL_NULL(lastassailant)
62+
lastassailant = null
6363
else
6464
lastassailant = makeweakref(M)
6565

0 commit comments

Comments
 (0)