From ce2b2f284ee5b900384ac997e42a03a7c961bc96 Mon Sep 17 00:00:00 2001 From: Lukas Moungos Date: Sun, 15 Dec 2019 14:02:51 +0100 Subject: [PATCH] try fix blip Colors --- ReallifeGamemode.Server/Commands/FactionCommands.cs | 5 ++--- ReallifeGamemode.Server/Events/Login.cs | 4 +--- ReallifeGamemode.Server/Managers/InteractionManager.cs | 5 ++--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/ReallifeGamemode.Server/Commands/FactionCommands.cs b/ReallifeGamemode.Server/Commands/FactionCommands.cs index fc11bd9e..89177d2a 100644 --- a/ReallifeGamemode.Server/Commands/FactionCommands.cs +++ b/ReallifeGamemode.Server/Commands/FactionCommands.cs @@ -290,8 +290,7 @@ namespace ReallifeGamemode.Server.Commands } ChatService.SendMessage(target, "!{#8181E9}Deine Akte wurde von " + player.Name + " gelöscht. Grund: " + reason); ChatService.BroadcastFaction("!{#8181E9}HQ: Die Akte von " + target.Name + " wurde von " + player.Name + " gelöscht. Grund: " + reason + ".", new List() { 1, 3 }); - if (targetUser.Faction != null) - { + switch (targetUser.Faction.Name) { case "Ballas": @@ -304,7 +303,7 @@ namespace ReallifeGamemode.Server.Commands target.SetSharedData("blipColor", 5); break; } - } + else { target.SetSharedData("blipColor", 0); diff --git a/ReallifeGamemode.Server/Events/Login.cs b/ReallifeGamemode.Server/Events/Login.cs index c43e8007..98b6ee3c 100644 --- a/ReallifeGamemode.Server/Events/Login.cs +++ b/ReallifeGamemode.Server/Events/Login.cs @@ -58,8 +58,6 @@ namespace ReallifeGamemode.Server.Events player.SetData("editmode", false); player.SetData("quicksavemode", "none"); } - if(user.Faction != null) - { switch (user.Faction.Name) { case "Ballas": @@ -72,7 +70,7 @@ namespace ReallifeGamemode.Server.Events player.SetSharedData("blipColor", 5); break; } - } + var userBankAccount = user.GetBankAccount(); userBankAccount.Balance = userBankAccount.Balance; diff --git a/ReallifeGamemode.Server/Managers/InteractionManager.cs b/ReallifeGamemode.Server/Managers/InteractionManager.cs index 991df11a..ca887314 100644 --- a/ReallifeGamemode.Server/Managers/InteractionManager.cs +++ b/ReallifeGamemode.Server/Managers/InteractionManager.cs @@ -63,8 +63,7 @@ namespace ReallifeGamemode.Server.Managers ChatService.SendMessage(leader, "!{02FCFF}" + player.Name + " hat die Einladung angenommen."); ChatService.SendMessage(player, "!{02FCFF}Du hast die Einladung angenommen."); - if (own.Faction != null) - { + switch (own.Faction.Name) { case "Ballas": @@ -77,7 +76,7 @@ namespace ReallifeGamemode.Server.Managers player.SetSharedData("blipColor", 5); break; } - } + dbContext.SaveChanges(); } }