Skip to content

Commit

Permalink
Fix some rounds failing to end due to mind roles (space-wizards#32792)
Browse files Browse the repository at this point in the history
* Fix some rounds failing to end due to mind roles

Fixes space-wizards#32791

This is caused by ShowRoundEndScoreboard running into a bug trying to display antags: some player is showing up as antag with MindIsAntagonist(), but has no antag roles listed in MindGetAllRoleInfo().

This was caused by one of the roles of the player having the Antag boolean set, but having no AntagPrototype set.

The responsible mind role appeared to be MindRoleSubvertedSilicon which is missing a set for the SubvertedSilicon antag prototype.

I also added resilience to the round-end code to make it so that an exception showing the scoreboard (and sending the Discord message) would not cause the round end logic to completely abort from an exception.

I am planning to add an integration test to cover this bug (no prototype in mind roles), but I'll leave that for not-the-immediate-hotfix.

* At least one maintainer approved this tiny PR without reading it, not naming names.
  • Loading branch information
PJB3005 authored and sleepyyapril committed Dec 23, 2024
1 parent 13b9ad9 commit c2704bc
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Content.Server/GameTicking/GameTicker.RoundFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,23 @@ public void EndRound(string text = "")

RunLevel = GameRunLevel.PostRound;

ShowRoundEndScoreboard(text);
SendRoundEndDiscordMessage();
try
{
ShowRoundEndScoreboard(text);
}
catch (Exception e)
{
Log.Error($"Error while showing round end scoreboard: {e}");
}

try
{
SendRoundEndDiscordMessage();
}
catch (Exception e)
{
Log.Error($"Error while sending round end Discord message: {e}");
}
}

public void ShowRoundEndScoreboard(string text = "")
Expand Down

0 comments on commit c2704bc

Please sign in to comment.