Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
fix: Block rank changes for if module disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
K4ryuu committed Nov 13, 2023
1 parent e1cc9a4 commit d4ddbcc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Functions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ public void LoadPlayerData(CCSPlayerController player)
MySql!.Table("k4stats").InsertIfNotExist(values, $"`name` = '{escapedName}'");
MySql!.Table("k4ranks").InsertIfNotExist(values.Add("`rank`", MySqlHelper.EscapeString(noneRank)), $"`name` = '{escapedName}'");

if (!Config.GeneralSettings.ModuleRanks)
return;

MySqlQueryResult result = MySql!.Table("k4ranks").Where(MySqlQueryCondition.New("steam_id", "=", player.SteamID.ToString())).Select("points");

PlayerSummaries[player].Points = result.Rows > 0 ? result.Get<int>(0, "points") : 0;
Expand Down Expand Up @@ -276,6 +279,9 @@ public void ModifyClientPoints(CCSPlayerController player, CHANGE_MODE mode, int

public void CheckNewRank(CCSPlayerController player)
{
if (!Config.GeneralSettings.ModuleRanks)
return;

if (Config.RankSettings.ScoreboardScoreSync)
player.Score = PlayerSummaries[player].Points;

Expand Down

0 comments on commit d4ddbcc

Please sign in to comment.