Skip to content

Commit

Permalink
Merge pull request #12 from edgegamers/fix/invalidCooldown
Browse files Browse the repository at this point in the history
Fix map decrementing even if 5-min failed
  • Loading branch information
MSWS authored Jul 27, 2024
2 parents 9d070e5 + 91ee4a6 commit 680bc8e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/plugin/commands/elo/DownCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public override void OnCommand(CCSPlayerController? executor,
}

if (!Elo.GetPeriodLimiter().Decrement(source.Value)) {
Elo.GetMapLimiter().Increment(source.Value);

Check warning on line 42 in src/plugin/commands/elo/DownCommand.cs

View workflow job for this annotation

GitHub Actions / build

'IRateLimiter<ulong>.Increment(ulong)' is obsolete: 'This is a semaphore, are you sure you want to increment?'

Check warning on line 42 in src/plugin/commands/elo/DownCommand.cs

View workflow job for this annotation

GitHub Actions / build

'IRateLimiter<ulong>.Increment(ulong)' is obsolete: 'This is a semaphore, are you sure you want to increment?'

Check warning on line 42 in src/plugin/commands/elo/DownCommand.cs

View workflow job for this annotation

GitHub Actions / build

'IRateLimiter<ulong>.Increment(ulong)' is obsolete: 'This is a semaphore, are you sure you want to increment?'

Check warning on line 42 in src/plugin/commands/elo/DownCommand.cs

View workflow job for this annotation

GitHub Actions / build

'IRateLimiter<ulong>.Increment(ulong)' is obsolete: 'This is a semaphore, are you sure you want to increment?'
info.ReplyLocalized(Elo.GetBase().Localizer, "out_of_rep_period");
return;
}
Expand Down
1 change: 1 addition & 0 deletions src/plugin/commands/elo/UpCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public override void OnCommand(CCSPlayerController? executor,
}

if (!Elo.GetPeriodLimiter().Decrement(source.Value)) {
Elo.GetMapLimiter().Increment(source.Value);

Check warning on line 41 in src/plugin/commands/elo/UpCommand.cs

View workflow job for this annotation

GitHub Actions / build

'IRateLimiter<ulong>.Increment(ulong)' is obsolete: 'This is a semaphore, are you sure you want to increment?'

Check warning on line 41 in src/plugin/commands/elo/UpCommand.cs

View workflow job for this annotation

GitHub Actions / build

'IRateLimiter<ulong>.Increment(ulong)' is obsolete: 'This is a semaphore, are you sure you want to increment?'

Check warning on line 41 in src/plugin/commands/elo/UpCommand.cs

View workflow job for this annotation

GitHub Actions / build

'IRateLimiter<ulong>.Increment(ulong)' is obsolete: 'This is a semaphore, are you sure you want to increment?'

Check warning on line 41 in src/plugin/commands/elo/UpCommand.cs

View workflow job for this annotation

GitHub Actions / build

'IRateLimiter<ulong>.Increment(ulong)' is obsolete: 'This is a semaphore, are you sure you want to increment?'
info.ReplyLocalized(Elo.GetBase().Localizer, "out_of_rep_period");
return;
}
Expand Down

0 comments on commit 680bc8e

Please sign in to comment.