From 368d80194051542bfbcc7e7c9f5c67ea910735b8 Mon Sep 17 00:00:00 2001 From: Putnam Date: Thu, 16 Apr 2020 08:17:48 -0700 Subject: [PATCH] Makes objectives clean theirselves up properly. --- code/game/gamemodes/objective.dm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 4497f9faef..ed0786eb07 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -19,6 +19,16 @@ GLOBAL_LIST_EMPTY(objectives) if(text) explanation_text = text +/datum/objective/Destroy(force, ...) + GLOB.objectives -= src + if(owner) + for(var/datum/antagonist/A in owner.antag_datums) + if(locate(src) in A.objectives) + A.objectives -= src + if(team) + team.objectives -= src + . = ..() + /datum/objective/proc/get_owners() // Combine owner and team into a single list. . = (team && team.members) ? team.members.Copy() : list() if(owner)