From dbc5abb1ec7b64ce0b5878e4cc5ec3fbef4552cd Mon Sep 17 00:00:00 2001
From: SkyratBot <59378654+SkyratBot@users.noreply.github.com>
Date: Wed, 26 Apr 2023 15:08:26 +0100
Subject: [PATCH] [MIRROR] Fixed final objectives appearing as skipped in the
traitor panel [MDB IGNORE] (#20778)
* Fixed final objectives appearing as skipped in the traitor panel (#74956)
## About The Pull Request
Final objectives appear as skipped due to them setting the 'skipped'
variable on themselves to TRUE when failing all other objectives.
Also stops admins from unintentionally bugging the final objective by
failing/succeeding it whilst it is taken.
Closes #74929
## Why It's Good For The Game
Bugfix
## Changelog
:cl:
fix: Fixed final objectives appearing as 'Skipped' in the traitor panel.
/:cl:
Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com>
* Fixed final objectives appearing as skipped in the traitor panel
---------
Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com>
---
code/modules/antagonists/traitor/datum_traitor.dm | 2 +-
.../traitor/objectives/final_objective/final_objective.dm | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/code/modules/antagonists/traitor/datum_traitor.dm b/code/modules/antagonists/traitor/datum_traitor.dm
index 486e6e37586..59c92c6d172 100644
--- a/code/modules/antagonists/traitor/datum_traitor.dm
+++ b/code/modules/antagonists/traitor/datum_traitor.dm
@@ -106,7 +106,7 @@
else
string += ", [to_display.telecrystal_reward] TC"
string += ", [to_display.progression_reward] PR"
- if(to_display.objective_state == OBJECTIVE_STATE_ACTIVE)
+ if(to_display.objective_state == OBJECTIVE_STATE_ACTIVE && !istype(to_display, /datum/traitor_objective/ultimate))
string += " Fail this objective"
string += " Succeed this objective"
if(to_display.objective_state == OBJECTIVE_STATE_INACTIVE)
diff --git a/code/modules/antagonists/traitor/objectives/final_objective/final_objective.dm b/code/modules/antagonists/traitor/objectives/final_objective/final_objective.dm
index c8aad8e6b6a..47b9b3b0167 100644
--- a/code/modules/antagonists/traitor/objectives/final_objective/final_objective.dm
+++ b/code/modules/antagonists/traitor/objectives/final_objective/final_objective.dm
@@ -31,6 +31,8 @@
. = ..()
handler.maximum_potential_objectives = 0
for(var/datum/traitor_objective/objective as anything in handler.potential_objectives)
+ if(objective == src)
+ continue
objective.fail_objective()
user.playsound_local(get_turf(user), 'sound/traitor/final_objective.ogg', vol = 100, vary = FALSE, channel = CHANNEL_TRAITOR)
handler.final_objective = name