Skip to content

Commit

Permalink
Cleans up bot card and access on Destroy()/gib()
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Feb 8, 2025
1 parent d21758d commit 0872878
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions code/modules/mob/living/bot/bot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
var/light_strength = 3
var/busy = 0

// Dummy object used to hold bot access strings. TODO: just put it on the mob.
var/obj/access_scanner = null
var/list/req_access = list()

Expand All @@ -38,9 +39,6 @@

layer = HIDING_MOB_LAYER

/mob/living/bot/isSynthetic()
return TRUE

/mob/living/bot/Initialize()
. = ..()
update_icon()
Expand Down Expand Up @@ -442,3 +440,17 @@
. = ..()
if(istype(botcard) && !is_type_in_list(botcard, exceptions))
LAZYDISTINCTADD(., botcard)

// We don't want to drop these on gib().
/mob/living/bot/physically_destroyed(skip_qdel)
QDEL_NULL(botcard)
QDEL_NULL(access_scanner)
return ..()

/mob/living/bot/Destroy()
QDEL_NULL(botcard)
QDEL_NULL(access_scanner)
return ..()

/mob/living/bot/isSynthetic()
return TRUE

0 comments on commit 0872878

Please sign in to comment.