From 2d94c58e6da96cd0ad8c915247f12bf7a0be25a9 Mon Sep 17 00:00:00 2001 From: VegaZ Date: Wed, 21 Nov 2018 18:01:25 +0100 Subject: [PATCH] Fix accessories reset --- Server/Events/UpdateCharacterCloth.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Server/Events/UpdateCharacterCloth.cs b/Server/Events/UpdateCharacterCloth.cs index dba839a6..2c5cf4c0 100644 --- a/Server/Events/UpdateCharacterCloth.cs +++ b/Server/Events/UpdateCharacterCloth.cs @@ -174,19 +174,17 @@ namespace reallife_gamemode.Server.Events using (var context = new DatabaseContext()) { List charClothes = context.CharacterClothes.ToList().FindAll(c => c.UserId == user.Id && c.Duty == false); + player.ClearAccessory(0); + player.ClearAccessory(1); + player.ClearAccessory(2); + player.ClearAccessory(6); + player.ClearAccessory(7); - foreach(var cloth in charClothes) + foreach (var cloth in charClothes) { if(cloth.SlotType == 1) { - if (cloth.ClothId == -1) - { - player.ClearAccessory(cloth.SlotId); - } - else - { - player.SetAccessories(cloth.SlotId, cloth.ClothId, 0); - } + player.SetAccessories(cloth.SlotId, cloth.ClothId, 0); } else {