Skip to content

Commit

Permalink
handle player exile
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxinal committed Nov 8, 2020
1 parent 3f1f0c5 commit 92f7c46
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions handlers/EventHandler.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.Extensions.Logging;
using Impostor.Api.Events;
using Impostor.Api.Events.Meeting;
using Impostor.Api.Events.Player;
using Impostor.Plugins.ImpostorCord.Discord;


Expand Down Expand Up @@ -30,12 +31,6 @@ public async void OnMeetingStarted(IMeetingStartedEvent e)
[EventListener]
public async void OnMeetingEnded(IMeetingEndedEvent e)
{
foreach (var player in e.Game.Players)
{
if(player.Character.PlayerInfo.IsDead){
Bot.games[e.Game.Code.Code].players[player.Character.PlayerInfo.ColorId].isDead = true;
}
}
await Bot.Tasks(e.Game.Code.Code, 10);
}
[EventListener]
Expand All @@ -60,6 +55,10 @@ public void OnGameDestroyed(IGameDestroyedEvent e)
{
Bot.games.Remove(e.Game.Code.Code);
}
[EventListener]
public void OnPlayerExhiled(IPlayerExileEvent e){
Bot.games[e.Game.Code.Code].players[e.PlayerControl.PlayerInfo.ColorId].isDead = true;
}

}
}

0 comments on commit 92f7c46

Please sign in to comment.