mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-29 06:05:17 +01:00
Actually not an off by one
This commit is contained in:
parent
0f6842991b
commit
dddabd13b8
@ -671,7 +671,7 @@ public class CommandTrait extends Trait {
|
|||||||
}
|
}
|
||||||
trait.globalCooldowns.remove(commandKey);
|
trait.globalCooldowns.remove(commandKey);
|
||||||
}
|
}
|
||||||
int timesUsed = nUsed.getOrDefault(commandKey, 0) + 1;
|
int timesUsed = nUsed.getOrDefault(commandKey, 0);
|
||||||
if (command.n > 0 && command.n <= timesUsed) {
|
if (command.n > 0 && command.n <= timesUsed) {
|
||||||
trait.sendErrorMessage(player, CommandTraitError.MAXIMUM_TIMES_USED, null, command.n);
|
trait.sendErrorMessage(player, CommandTraitError.MAXIMUM_TIMES_USED, null, command.n);
|
||||||
return false;
|
return false;
|
||||||
@ -683,7 +683,7 @@ public class CommandTrait extends Trait {
|
|||||||
trait.globalCooldowns.put(commandKey, currentTimeSec);
|
trait.globalCooldowns.put(commandKey, currentTimeSec);
|
||||||
}
|
}
|
||||||
if (command.n > 0) {
|
if (command.n > 0) {
|
||||||
nUsed.put(commandKey, timesUsed);
|
nUsed.put(commandKey, timesUsed + 1);
|
||||||
}
|
}
|
||||||
lastUsedId = command.id;
|
lastUsedId = command.id;
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user