evtl fix character

This commit is contained in:
hydrant
2020-08-04 21:07:42 +02:00
parent cf11eb463b
commit b636d87afa
2 changed files with 10 additions and 3 deletions

View File

@@ -47,12 +47,12 @@ namespace ReallifeGamemode.Server.Extensions
{ {
using (context = new DatabaseContext()) using (context = new DatabaseContext())
{ {
return context.Characters.FirstOrDefault(u => u.UserId == user.Id); return context.Characters.FirstOrDefault(u => u.Id == user.CharacterId);
} }
} }
else else
{ {
return context.Characters.FirstOrDefault(u => u.UserId == user.Id); return context.Characters.FirstOrDefault(u => u.Id == user.CharacterId);
} }
} }

View File

@@ -32,7 +32,14 @@ namespace ReallifeGamemode.Server.Shop.Clothing
public void LoadShopNUI(Player client) public void LoadShopNUI(Player client)
{ {
bool gender = client.GetUser().GetCharacter().Gender; User u = client.GetUser();
if (u == null)
{
return;
}
bool gender = u.GetCharacter().Gender;
List<ShopClothe> tops = clotheList.ToList().FindAll(c => c.Gender == gender && c.ComponentId == 11); List<ShopClothe> tops = clotheList.ToList().FindAll(c => c.Gender == gender && c.ComponentId == 11);
List<ShopClothe> legs = clotheList.ToList().FindAll(c => c.Gender == gender && c.ComponentId == 4); List<ShopClothe> legs = clotheList.ToList().FindAll(c => c.Gender == gender && c.ComponentId == 4);
List<ShopClothe> shoes = clotheList.ToList().FindAll(c => c.Gender == gender && c.ComponentId == 6); List<ShopClothe> shoes = clotheList.ToList().FindAll(c => c.Gender == gender && c.ComponentId == 6);