evtl fix dienstkleidung
This commit is contained in:
@@ -618,6 +618,11 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
{
|
{
|
||||||
if (!player.IsLoggedIn()) return;
|
if (!player.IsLoggedIn()) return;
|
||||||
var user = player.GetUser();
|
var user = player.GetUser();
|
||||||
|
if (user == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (user?.FactionId != null)
|
if (user?.FactionId != null)
|
||||||
{
|
{
|
||||||
DutyPoint nearest = PositionManager.DutyPoints.Find(d => d.Position.DistanceTo(player.Position) <= 1.5);
|
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())
|
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)
|
foreach (var cloth in clothes)
|
||||||
{
|
{
|
||||||
if (cloth.SlotType == 1)
|
if (cloth.SlotType == 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user