From ac733186c7a4937adc11ff0892d281357a7d086b Mon Sep 17 00:00:00 2001 From: MCrow Date: Sat, 28 Dec 2024 11:08:23 +0100 Subject: [PATCH] Fix salaries --- Uconomy/Services/SalaryService.cs | 6 ++++-- Uconomy/Uconomy.csproj | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Uconomy/Services/SalaryService.cs b/Uconomy/Services/SalaryService.cs index bea3160..200ed63 100644 --- a/Uconomy/Services/SalaryService.cs +++ b/Uconomy/Services/SalaryService.cs @@ -33,12 +33,13 @@ void OnDestroy() StopAllCoroutines(); } - + private void OnPlayerConnected(UnturnedPlayer player) { if (Uconomy.Instance.Configuration.Instance.EnableSalaries) { - StartCoroutine(GiveSalary(player.CSteamID)); + var coroutine = StartCoroutine(GiveSalary(player.CSteamID)); + coroutines[player.CSteamID] = coroutine; } } @@ -60,6 +61,7 @@ private IEnumerator GiveSalary(CSteamID steamID) Player player = PlayerTool.getPlayer(steamID); if (player == null) { + coroutines.Remove(steamID); yield break; } diff --git a/Uconomy/Uconomy.csproj b/Uconomy/Uconomy.csproj index 71ef473..3566073 100644 --- a/Uconomy/Uconomy.csproj +++ b/Uconomy/Uconomy.csproj @@ -5,7 +5,7 @@ latest fr34kyn01535.Uconomy Uconomy - 2.1.0 + 2.1.1 Uconomy