From: miniduikboot Date: Wed, 3 Jul 2024 21:01:51 +0000 (+0200) Subject: Let hosts handle exiles X-Git-Tag: v1.10.0~14 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=c6bad153466142617b886a9a5a5c22650e9fecaf;p=rhonda%2Fimpostor.git Let hosts handle exiles Previously Impostor liked to kill exiled players server side to raise an event. This is quite early, as the host will SetRole them to a ghost role later. However as PlayerInfo is server-owned by default in 2024.6.18, it starts killing players client side. This caused meetings to immediately conclude if the final impostor was voted out, ruining the cutscene. So this commit makes Impostor wait for hosts to actually kill the player using SetRole. Do set the LastDeathReason property though for players using the API. --- diff --git a/src/Impostor.Server/Net/Inner/Objects/InnerMeetingHud.cs b/src/Impostor.Server/Net/Inner/Objects/InnerMeetingHud.cs index 6b6e379..78916c2 100644 --- a/src/Impostor.Server/Net/Inner/Objects/InnerMeetingHud.cs +++ b/src/Impostor.Server/Net/Inner/Objects/InnerMeetingHud.cs @@ -289,7 +289,7 @@ namespace Impostor.Server.Net.Inner.Objects if (exiled != null) { - exiled.Die(DeathReason.Exile); + exiled.PlayerInfo.LastDeathReason = DeathReason.Exile; await _eventManager.CallAsync(new PlayerExileEvent(Game, Game.GetClientPlayer(exiled!.OwnerId)!, exiled)); }