diff --git a/EXILED/Exiled.Events/Patches/Events/Player/ChangingRoleAndSpawned.cs b/EXILED/Exiled.Events/Patches/Events/Player/ChangingRoleAndSpawned.cs index d31306a20..a4c5c6100 100644 --- a/EXILED/Exiled.Events/Patches/Events/Player/ChangingRoleAndSpawned.cs +++ b/EXILED/Exiled.Events/Patches/Events/Player/ChangingRoleAndSpawned.cs @@ -186,7 +186,10 @@ private static void ChangeInventory(ChangingRoleEventArgs ev) { try { - if (!NetworkServer.active || ev == null || !ev.SpawnFlags.HasFlag(RoleSpawnFlags.AssignInventory)) + if (ev is null) + return; + + if (ev.ShouldPreserveInventory || ev.Reason == API.Enums.SpawnReason.Destroyed) return; Inventory inventory = ev.Player.Inventory; diff --git a/EXILED/Exiled.Loader/Loader.cs b/EXILED/Exiled.Loader/Loader.cs index 1a8a55c7c..2c3ce68de 100644 --- a/EXILED/Exiled.Loader/Loader.cs +++ b/EXILED/Exiled.Loader/Loader.cs @@ -662,4 +662,4 @@ private static void LoadDependencies() } } } -} +} \ No newline at end of file