FindCommand (command)
for(var/Command/C in CommandList)
sleep(10) //debug
world << "Testing [command] against [C.name] and [list2params(C.aliases)]." //debug
if (command == C.name || command in C.aliases)
world << "Found" //debug
return C
return 0
Problem description:
In CommandList I have a command which I named "test". It also has an alias list with "test2", "bleargh", and "helloworld".
I added that little debug output to confirm that the the command itself was set up. Here is the output:
Testing test against test and test2&bleargh&helloworld.
But for some reason, if my command is "test" it never gets to the "Found" part. However, test2, bleargh, and helloworld all get the "Found" part and return the command.
I took out the || command in C.aliases part of the if() and "test" worked fine. I can only guess that for whatever reason, having that command in C.aliases part messes up the first part of the if. I could just do two separate if()s, but it annoys me that it doesn't work when it looks like it should.
Does anyone see something that I'm doing wrong, or does this look like a bug?