From ade0be3e4103a453a7376a94fe2ae59689cddb30 Mon Sep 17 00:00:00 2001 From: Lucy Date: Tue, 23 Apr 2024 11:36:36 -0400 Subject: [PATCH 1/4] Fix team-related runtimes (which broke roundend reports) --- code/__HELPERS/roundend.dm | 4 +++- code/modules/antagonists/_common/antag_team.dm | 2 ++ code/modules/events/wizard/imposter.dm | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm index 07df001f3a51..493784430ab9 100644 --- a/code/__HELPERS/roundend.dm +++ b/code/__HELPERS/roundend.dm @@ -678,9 +678,11 @@ GLOBAL_LIST_INIT(round_end_images, world.file2list("data/image_urls.txt")) // MO //check if we should show the team if(!active_teams.show_roundend_report) continue - //remove the team's individual antag reports, if the team actually shows up in the report. for(var/datum/mind/team_minds as anything in active_teams.members) + if(!istype(team_minds)) + stack_trace("Non-mind ([team_minds?.type]) found in team.members!") + continue if(!isnull(team_minds.antag_datums)) // is_special_character passes if they have a special role instead of an antag all_antagonists -= team_minds.antag_datums diff --git a/code/modules/antagonists/_common/antag_team.dm b/code/modules/antagonists/_common/antag_team.dm index ad3754e757e8..ccb895dda6b9 100644 --- a/code/modules/antagonists/_common/antag_team.dm +++ b/code/modules/antagonists/_common/antag_team.dm @@ -33,6 +33,8 @@ GLOBAL_LIST_EMPTY(antagonist_teams) return ..() /datum/team/proc/add_member(datum/mind/new_member) + if(!istype(new_member)) + CRASH("Attempted to add non-mind ([new_member?.type]) as a team member!") members |= new_member /datum/team/proc/remove_member(datum/mind/member) diff --git a/code/modules/events/wizard/imposter.dm b/code/modules/events/wizard/imposter.dm index 2770b1136761..eca12b33bb51 100644 --- a/code/modules/events/wizard/imposter.dm +++ b/code/modules/events/wizard/imposter.dm @@ -33,7 +33,7 @@ var/datum/antagonist/wizard/apprentice/imposter/imposter = new() imposter.master = M imposter.wiz_team = master.wiz_team - master.wiz_team.add_member(imposter) + master.wiz_team.add_member(I.mind) I.mind.add_antag_datum(imposter) I.mind.special_role = "imposter" I.log_message("is an imposter!", LOG_ATTACK, color="red") //? From 5c8e89e60d7950101745a2019985c4877cd609b6 Mon Sep 17 00:00:00 2001 From: Lucy Date: Tue, 23 Apr 2024 12:04:26 -0400 Subject: [PATCH 2/4] add more sanity checks --- code/__HELPERS/roundend.dm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm index 493784430ab9..672ca4be39d8 100644 --- a/code/__HELPERS/roundend.dm +++ b/code/__HELPERS/roundend.dm @@ -667,9 +667,15 @@ GLOBAL_LIST_INIT(round_end_images, world.file2list("data/image_urls.txt")) // MO var/list/all_antagonists = list() for(var/datum/team/team as anything in GLOB.antagonist_teams) + if(!istype(team)) + stack_trace("Non-mind ([team?.type]) found in GLOB.antagonist_teams!") + continue all_teams |= team for(var/datum/antagonist/antagonists as anything in GLOB.antagonists) + if(!istype(antagonists)) + stack_trace("Non-mind ([antagonists?.type]) found in GLOB.antagonists!") + continue if(!antagonists.owner) continue all_antagonists |= antagonists @@ -710,8 +716,8 @@ GLOBAL_LIST_INIT(round_end_images, world.file2list("data/image_urls.txt")) // MO result += "

" CHECK_TICK - if(all_antagonists.len) - var/datum/antagonist/last = all_antagonists[all_antagonists.len] + if(length(all_antagonists)) + var/datum/antagonist/last = all_antagonists[length(all_antagonists)] result += last.roundend_report_footer() result += "" From e1e8dc43f71583220fd6fe48deebe022ba190704 Mon Sep 17 00:00:00 2001 From: Lucy Date: Tue, 23 Apr 2024 16:01:55 -0400 Subject: [PATCH 3/4] Update code/__HELPERS/roundend.dm Co-authored-by: wraith-54321 <69217972+wraith-54321@users.noreply.github.com> --- code/__HELPERS/roundend.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm index 672ca4be39d8..dfdd2a23f256 100644 --- a/code/__HELPERS/roundend.dm +++ b/code/__HELPERS/roundend.dm @@ -674,7 +674,7 @@ GLOBAL_LIST_INIT(round_end_images, world.file2list("data/image_urls.txt")) // MO for(var/datum/antagonist/antagonists as anything in GLOB.antagonists) if(!istype(antagonists)) - stack_trace("Non-mind ([antagonists?.type]) found in GLOB.antagonists!") + stack_trace("Non-antagonist ([antagonists?.type]) found in GLOB.antagonists!") continue if(!antagonists.owner) continue From 40cf506d4b951a9ccf7e41b59f5af295114a3dd6 Mon Sep 17 00:00:00 2001 From: Lucy Date: Tue, 23 Apr 2024 16:02:00 -0400 Subject: [PATCH 4/4] Update code/__HELPERS/roundend.dm Co-authored-by: wraith-54321 <69217972+wraith-54321@users.noreply.github.com> --- code/__HELPERS/roundend.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm index dfdd2a23f256..9bf7d3335413 100644 --- a/code/__HELPERS/roundend.dm +++ b/code/__HELPERS/roundend.dm @@ -668,7 +668,7 @@ GLOBAL_LIST_INIT(round_end_images, world.file2list("data/image_urls.txt")) // MO for(var/datum/team/team as anything in GLOB.antagonist_teams) if(!istype(team)) - stack_trace("Non-mind ([team?.type]) found in GLOB.antagonist_teams!") + stack_trace("Non-team ([team?.type]) found in GLOB.antagonist_teams!") continue all_teams |= team