Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix team-related runtimes (which broke roundend reports) #1728

Merged
merged 4 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions code/__HELPERS/roundend.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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!")
Absolucy marked this conversation as resolved.
Show resolved Hide resolved
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!")
Absolucy marked this conversation as resolved.
Show resolved Hide resolved
continue
if(!antagonists.owner)
continue
all_antagonists |= antagonists
Expand All @@ -678,9 +684,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

Expand Down Expand Up @@ -708,8 +716,8 @@ GLOBAL_LIST_INIT(round_end_images, world.file2list("data/image_urls.txt")) // MO
result += "<br><br>"
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 += "</div>"

Expand Down
2 changes: 2 additions & 0 deletions code/modules/antagonists/_common/antag_team.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/events/wizard/imposter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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") //?
Expand Down
Loading