fixed nullpointer

This commit is contained in:
MasterGordon 2022-11-11 16:25:23 +01:00
parent 9a07af8212
commit 3899b39314
1 changed files with 1 additions and 1 deletions

View File

@ -47,7 +47,7 @@ class Frontend : IFrontend
{
var mousePos = new Vector2(e.motion.x, e.motion.y);
ctx.FrontendGameState.MousePosition = mousePos;
if (ctx.GameState.Players.Find(player => player.Guid == ctx.FrontendGameState.PlayerGuid).Mining != Vector2.Zero)
if (ctx.GameState.Players.Find(player => player.Guid == ctx.FrontendGameState.PlayerGuid)?.Mining != Vector2.Zero)
{
var amp = ctx.FrontendGameState.MousePosition / ctx.FrontendGameState.Settings.GameScale + ctx.FrontendGameState.Camera.Position;
ctx.Backend.ProcessPacket(new BreakPacket(ctx.FrontendGameState.PlayerGuid, amp));