Skip to content

Commit

Permalink
Fix command tool not working without arguments (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
CrackedMatter committed Nov 21, 2023
1 parent a03bb5d commit c61b5ac
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/server/tools/command_tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ class CommandTool extends Tool {

use = function (self: CommandTool, player: Player, session: PlayerSession) {
if (self.isCustom) {
const firstSpace = self.command.indexOf(" ");
let firstSpace = self.command.indexOf(" ");
if (firstSpace == -1) {
firstSpace = self.command.length;
}
const usingItem = session.usingItem;
session.usingItem = false;
Server.command.callCommand(player, self.command.substring(0, firstSpace).trim(), self.command.substring(firstSpace).trim());
Expand Down

0 comments on commit c61b5ac

Please sign in to comment.