Fix accessories reset

This commit is contained in:
VegaZ
2018-11-21 18:01:25 +01:00
parent 056fe7385f
commit 2d94c58e6d

View File

@@ -174,20 +174,18 @@ namespace reallife_gamemode.Server.Events
using (var context = new DatabaseContext())
{
List<CharacterCloth> 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)
{
if(cloth.SlotType == 1)
{
if (cloth.ClothId == -1)
{
player.ClearAccessory(cloth.SlotId);
}
else
{
player.SetAccessories(cloth.SlotId, cloth.ClothId, 0);
}
}
else
{
player.SetClothes(cloth.SlotId, cloth.ClothId, 0);