Fix accessories reset
This commit is contained in:
@@ -174,20 +174,18 @@ namespace reallife_gamemode.Server.Events
|
|||||||
using (var context = new DatabaseContext())
|
using (var context = new DatabaseContext())
|
||||||
{
|
{
|
||||||
List<CharacterCloth> charClothes = context.CharacterClothes.ToList().FindAll(c => c.UserId == user.Id && c.Duty == false);
|
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)
|
foreach (var cloth in charClothes)
|
||||||
{
|
{
|
||||||
if(cloth.SlotType == 1)
|
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
|
else
|
||||||
{
|
{
|
||||||
player.SetClothes(cloth.SlotId, cloth.ClothId, 0);
|
player.SetClothes(cloth.SlotId, cloth.ClothId, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user