From 368d80194051542bfbcc7e7c9f5c67ea910735b8 Mon Sep 17 00:00:00 2001 From: Putnam Date: Thu, 16 Apr 2020 08:17:48 -0700 Subject: [PATCH 1/2] 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) From 87dd2681cae9ecfa6e33a1240096b1cb5bf0acf9 Mon Sep 17 00:00:00 2001 From: Putnam Date: Thu, 16 Apr 2020 08:30:55 -0700 Subject: [PATCH 2/2] The locate isn't necessary --- code/game/gamemodes/objective.dm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index ed0786eb07..3b95b1281f 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -23,8 +23,7 @@ GLOBAL_LIST_EMPTY(objectives) GLOB.objectives -= src if(owner) for(var/datum/antagonist/A in owner.antag_datums) - if(locate(src) in A.objectives) - A.objectives -= src + A.objectives -= src if(team) team.objectives -= src . = ..()