Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #45

Merged
merged 2 commits into from
Dec 18, 2024
Merged

Dev #45

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading