mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Fix command with trailing spaces + misspelling
This commit is contained in:
parent
5ae756577c
commit
4af917aa1b
1 changed files with 10 additions and 5 deletions
|
|
@ -78,10 +78,15 @@ namespace Dalamud.Game.Command {
|
|||
string command;
|
||||
string argument;
|
||||
|
||||
var speratorPosition = content.IndexOf(' ');
|
||||
if (speratorPosition == -1 || speratorPosition + 1 >= content.Length) {
|
||||
var separatorPosition = content.IndexOf(' ');
|
||||
if (separatorPosition == -1 || separatorPosition + 1 >= content.Length) {
|
||||
// If no space was found or ends with the space. Process them as a no argument
|
||||
command = content;
|
||||
if (separatorPosition + 1 >= content.Length) {
|
||||
// Remove the trailing space
|
||||
command = content.Substring(0, separatorPosition);
|
||||
} else {
|
||||
command = content;
|
||||
}
|
||||
argument = string.Empty;
|
||||
} else {
|
||||
// e.g.)
|
||||
|
|
@ -90,9 +95,9 @@ namespace Dalamud.Game.Command {
|
|||
// => command: 0-12 (12 chars)
|
||||
// => argument: 13-17 (4 chars)
|
||||
// => content.IndexOf(' ') == 12
|
||||
command = content.Substring(0, speratorPosition);
|
||||
command = content.Substring(0, separatorPosition);
|
||||
|
||||
var argStart = speratorPosition + 1;
|
||||
var argStart = separatorPosition + 1;
|
||||
argument = content.Substring(argStart, content.Length - argStart);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue