Skip to content

Commit

Permalink
Merge pull request #45 from edgegamers/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
MSWS authored Dec 18, 2024
2 parents f522ff2 + 9907a80 commit 902254d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/GangsImpl/AbstractDB/AbstractInstanceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public abstract class AbstractInstanceManager<TK>(string connectionString,
$"SELECT {(typeof(TV).IsBasicallyPrimitive() ? statId : GetFieldNames<TV>())} FROM {table_prefix}_{statId} WHERE {PrimaryKey} = @{PrimaryKey}",
dynamic);
if (result == null) return (true, result);
if (!cache.ContainsKey(statId)) cache[statId] = new();
if (!cache.ContainsKey(statId)) cache[statId] = new Dictionary<TK, object>();
cache[statId][key] = result;
return (true, result);
} catch (InvalidOperationException e) {
Expand Down
5 changes: 3 additions & 2 deletions src/GangsImpl/Stats/Perk/Smoke/SmokeColorMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ override protected Task<List<SmokeColor>> GetItems(PlayerWrapper player) {

override protected Task HandleItemSelection(PlayerWrapper player,
List<SmokeColor> items, int selectedIndex) {
commands.ProcessCommand(player, CommandCallingContext.Chat, "css_gang",
"smokecolor", items[selectedIndex].ToString());
if (selectedIndex > 0)
commands.ProcessCommand(player, CommandCallingContext.Chat, "css_gang",
"smokecolor", items[selectedIndex].ToString());
Close(player);
return Task.CompletedTask;
}
Expand Down
2 changes: 1 addition & 1 deletion src/GangsImpl/Stats/Perk/Smoke/SmokeListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ await gangStats.GetForGang<SmokePerkData>(gang,
continue;
}

color = data.Equipped.GetColor() ?? data.Equipped.PickRandom();
color = data.Equipped.GetColor() ?? data.Unlocked.PickRandom();
cachedGangs.Add(player.GangId.Value, color);
}

Expand Down

0 comments on commit 902254d

Please sign in to comment.