Removed User.GetFaction()

This commit is contained in:
hydrant
2019-03-10 13:02:03 +01:00
parent f732f053a8
commit ed069fd1d7
8 changed files with 39 additions and 43 deletions

View File

@@ -87,7 +87,7 @@ namespace ReallifeGamemode.Server.Events
{
//LSFD
case 2:
player.TriggerEvent("showFactionInteraction", user.FactionId, player.GetData("duty"), user.GetFaction().Name, user.FactionLeader, Medic.ReviveTasks.Count.ToString(), Medic.HealTasks.Count.ToString(), Medic.FireTasks.Count.ToString());
player.TriggerEvent("showFactionInteraction", user.FactionId, player.GetData("duty"), user.Faction.Name, user.FactionLeader, Medic.ReviveTasks.Count.ToString(), Medic.HealTasks.Count.ToString(), Medic.FireTasks.Count.ToString());
break;
}
}
@@ -115,7 +115,7 @@ namespace ReallifeGamemode.Server.Events
int medicCount = 0;
foreach(Client c in NAPI.Pools.GetAllPlayers())
{
if((c.GetUser()?.GetFaction().Id ?? 0) == 2)
if((c.GetUser()?.Faction.Id ?? 0) == 2)
{
medicCount++;
}
@@ -132,7 +132,7 @@ namespace ReallifeGamemode.Server.Events
player.NametagColor = nameTagColor;
using (var context = new DatabaseContext())
{
List<CharacterCloth> clothes = context.CharacterClothes.ToList().FindAll(u => u.UserId == user.Id && u.Duty == true);
List<CharacterCloth> clothes = context.CharacterClothes.Where(u => u.UserId == user.Id && u.Duty == true).ToList();
foreach(var cloth in clothes)
{