evtl fix dienstkleidung

This commit is contained in:
hydrant
2020-08-02 21:10:31 +02:00
parent f19d79d968
commit cc38bb8402

View File

@@ -618,6 +618,11 @@ namespace ReallifeGamemode.Server.Events
{
if (!player.IsLoggedIn()) return;
var user = player.GetUser();
if (user == null)
{
return;
}
if (user?.FactionId != null)
{
DutyPoint nearest = PositionManager.DutyPoints.Find(d => d.Position.DistanceTo(player.Position) <= 1.5);
@@ -631,7 +636,8 @@ namespace ReallifeGamemode.Server.Events
using (var context = new DatabaseContext())
{
List<DutyCloth> clothes = context.DutyClothes.ToList().FindAll(c => c.FactionId == user.FactionId && c.Gender == user.GetCharacter().Gender);
var gender = user.GetCharacter().Gender;
List<DutyCloth> clothes = context.DutyClothes.Where(c => c.FactionId == user.FactionId && c.Gender == gender).ToList();
foreach (var cloth in clothes)
{
if (cloth.SlotType == 1)