Makes some code tidy (#27391)

* erguertbngio3eunf3o2we4if

* woop de doo
This commit is contained in:
Contrabang
2024-11-19 10:51:58 +00:00
committed by GitHub
parent 105a2fa617
commit 1cda30a19f
4 changed files with 14 additions and 18 deletions
+4 -8
View File
@@ -238,7 +238,7 @@
return FALSE
/**
* Gets every objective this mind owns, including all of those from any antag datums they have, and returns them as a list.
* Gets every objective this mind owns, including all of those from any antag datums and teams they have, and returns them as a list.
*/
/datum/mind/proc/get_all_objectives(include_team = TRUE)
var/list/all_objectives = list()
@@ -246,11 +246,7 @@
all_objectives += objective_holder.get_objectives() // Get their personal objectives
for(var/datum/antagonist/A as anything in antag_datums)
all_objectives += A.objective_holder.get_objectives() // Add all antag datum objectives.
if(include_team)
var/datum/team/team = A.get_team()
if(team) // have to make asure a team exists here, team?. does not work below because it will add the null to the list
all_objectives += team.objective_holder.get_objectives() // Get all of their teams' objectives
all_objectives += A.get_antag_objectives(include_team) // Add all antag datum objectives, and possibly antag team objectives
// For custom non-antag role teams
if(include_team && LAZYLEN(teams))
@@ -279,9 +275,9 @@
if(!remove_from_everything)
return
for(var/datum/antagonist/A as anything in antag_datums)
A.objective_holder.remove_objective(O) // Add all antag datum objectives.
A.remove_antag_objective(O)
var/datum/team/team = A.get_team()
team?.objective_holder.remove_objective(O) // Get all of their teams' objectives
team?.objective_holder.remove_objective(O)
/datum/mind/proc/_memory_edit_header(gamemode, list/alt)
. = gamemode