Invalid levels given returns an error instead.

This commit is contained in:
Lucca Faria Ferri 2023-02-01 11:04:30 -08:00
parent 0db3d0bf12
commit 591c2845ac

View File

@ -22,8 +22,8 @@ public class LevelUpCommand : CommandGroup
var amount = 1;
if (@params != null)
if (!int.TryParse(@params[0], out amount))
amount = 1;
if (!int.TryParse(@params[0], out amount) || amount < 1)
return "Invalid amount of levels.";
for (var i = 0; i < amount; i++)
if (player.Level >= 70)