evtl fix crash bei tot

This commit is contained in:
hydrant
2020-08-02 21:13:34 +02:00
parent cc38bb8402
commit d7e679a81c
2 changed files with 21 additions and 4 deletions

View File

@@ -27,7 +27,11 @@ namespace ReallifeGamemode.Server.Events
[ServerEvent(Event.PlayerDeath)]
public void OnPlayerDeath(Player player, Player killer, uint reason)
{
if (!player.IsLoggedIn()) player.Kick();
if (!player.IsLoggedIn())
{
player.Kick();
return;
}
player.SetData("isDead", true);
//TODO: Zum Full Release entfernen
@@ -49,7 +53,12 @@ namespace ReallifeGamemode.Server.Events
}
else
{
killerId = killer.GetUser().Id;
var killerUser = killer.GetUser();
if (killerUser == null)
{
return;
}
killerId = killerUser.Id;
killerPosX = killer.Position.X;
killerPosY = killer.Position.Y;
killerPosZ = killer.Position.Z;