Skip to content

Commit 50c66cc

Browse files
committed
Code cleanup
1 parent 616a06f commit 50c66cc

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

Store/src/cs2-store.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Store;
1111
public class Store : BasePlugin, IPluginConfig<Item_Config>
1212
{
1313
public override string ModuleName => "Store";
14-
public override string ModuleVersion => "1.9";
14+
public override string ModuleVersion => "2.0";
1515
public override string ModuleAuthor => "schwarper";
1616

1717
public Item_Config Config { get; set; } = new();

Store/src/findtarget/findtarget.cs

+3-8
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,10 @@ public static TargetFind Find(CommandInfo command, bool singleTarget, bool allow
2525
{
2626
if (allowSteamID)
2727
{
28-
// Get the argument and remove whitespace
2928
string arg = command.GetArg(1).Trim();
3029

31-
SteamID? steamId = null;
32-
// Try the standard parsing method
33-
if (!SteamID.TryParse(arg, out steamId) || steamId == null)
30+
if (!SteamID.TryParse(arg, out SteamID? steamId) || steamId == null)
3431
{
35-
// If standard parsing fails, try converting as a number
3632
if (ulong.TryParse(arg, out ulong steamIdNum))
3733
{
3834
steamId = new SteamID(steamIdNum);
@@ -46,16 +42,15 @@ public static TargetFind Find(CommandInfo command, bool singleTarget, bool allow
4642

4743
if (playerdata == null)
4844
{
49-
// If not found, create a new offline record (you can adjust this logic as needed)
5045
playerdata = new Store_Player
5146
{
5247
SteamID = steamId.SteamId64,
5348
Credits = 0,
54-
PlayerName = steamId.SteamId64.ToString() // ou outro valor padrão
49+
PlayerName = steamId.SteamId64.ToString()
5550
};
5651
Instance.GlobalStorePlayers.Add(playerdata);
5752
}
58-
// Define the TargetName: if PlayerName is filled and different from SteamID, use it; otherwise, use SteamID.
53+
5954
string finalTargetName = (!string.IsNullOrEmpty(playerdata.PlayerName) &&
6055
playerdata.PlayerName != steamId.SteamId64.ToString())
6156
? playerdata.PlayerName

0 commit comments

Comments
 (0)