mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
Misc
This commit is contained in:
@@ -370,9 +370,9 @@ namespace ArchiSteamFarm {
|
||||
ushort cardsRemaining = 0;
|
||||
Match progressMatch = Regex.Match(progressText, @"\d+");
|
||||
|
||||
// This might fail if we have no card drops remaining, that's fine
|
||||
// This might fail if we have no card drops remaining, 0 is not printed in this case - that's fine
|
||||
if (progressMatch.Success) {
|
||||
if (!ushort.TryParse(progressMatch.Value, out cardsRemaining)) {
|
||||
if (!ushort.TryParse(progressMatch.Value, out cardsRemaining) || (cardsRemaining == 0)) {
|
||||
Bot.ArchiLogger.LogNullError(nameof(cardsRemaining));
|
||||
continue;
|
||||
}
|
||||
@@ -435,12 +435,12 @@ namespace ArchiSteamFarm {
|
||||
continue;
|
||||
}
|
||||
|
||||
float hours = 0;
|
||||
float hours = 0.0F;
|
||||
Match hoursMatch = Regex.Match(hoursString, @"[0-9\.,]+");
|
||||
|
||||
// This might fail if we have exactly 0.0 hours played, that's fine
|
||||
// This might fail if we have exactly 0.0 hours played, as it's not printed in that case - that's fine
|
||||
if (hoursMatch.Success) {
|
||||
if (!float.TryParse(hoursMatch.Value, NumberStyles.Number, CultureInfo.InvariantCulture, out hours)) {
|
||||
if (!float.TryParse(hoursMatch.Value, NumberStyles.Number, CultureInfo.InvariantCulture, out hours) || (hours <= 0.0F)) {
|
||||
Bot.ArchiLogger.LogNullError(nameof(hours));
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user