]> git.deb.at Git - rhonda/impostor.git/commitdiff
Let hosts handle exiles
authorminiduikboot <mini@duikbo.at>
Wed, 3 Jul 2024 21:01:51 +0000 (23:01 +0200)
committerminiduikboot <mini@duikbo.at>
Mon, 29 Jul 2024 17:58:33 +0000 (19:58 +0200)
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.

src/Impostor.Server/Net/Inner/Objects/InnerMeetingHud.cs

index 6b6e3794dc29beb7a229f7b7c3b7edd77ef7cf8b..78916c2b70188951c30aec8867253dd77c811812 100644 (file)
@@ -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));
             }