Skip to content

Commit

Permalink
cmd/argument.go: Fix crash for target arguments < 2 characters.
Browse files Browse the repository at this point in the history
Resolves #974.
  • Loading branch information
Sandertv committed Dec 28, 2024
1 parent 51a8300 commit 0eb07ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/cmd/argument.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func (p parser) parseTargets(line *Line, tx *world.Tx) ([]Target, error) {
if !ok {
return nil, line.UsageError()
}
switch first[:2] {
switch first[:min(len(first), 2)] {
case "@p":
pos := line.src.Position()
playerDistances := make([]float64, len(players))
Expand Down

0 comments on commit 0eb07ec

Please sign in to comment.