From 226a85e0546d415070b4420e463cda9a258293f6 Mon Sep 17 00:00:00 2001 From: CyberL1 Date: Fri, 23 Feb 2024 12:47:17 +0100 Subject: [PATCH] fix: removing players from world --- Minecraft-Realms-Emulator/Controllers/InvitesController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Minecraft-Realms-Emulator/Controllers/InvitesController.cs b/Minecraft-Realms-Emulator/Controllers/InvitesController.cs index 0443802..3fafc6e 100644 --- a/Minecraft-Realms-Emulator/Controllers/InvitesController.cs +++ b/Minecraft-Realms-Emulator/Controllers/InvitesController.cs @@ -145,9 +145,9 @@ namespace Minecraft_Realms_Emulator.Controllers var players = world.Players.ToList(); - var playerIndex = world.Players.FindIndex(p => p.Uuid == uuid); + var player = _context.Players.Where(p => p.World.Id == wId).FirstOrDefault(p => p.Uuid == uuid); - world.Players.RemoveAt(playerIndex); + _context.Players.Remove(player); var invite = await _context.Invites.FirstOrDefaultAsync(i => i.RecipeintUUID == uuid);