ID:143895
 
Code:
    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?
This is probably due to in having a lower order than ||. Stick parenthesis around command in C.aliases and see if it works.
In response to Cinnom
*smacks forehead* I knew that. Lack of air conditioning has turned my brain to mush though. Yeah... that's my excuse. :)

Thanks for reminding me.

And on another note... WOAH! Cinnom! I haven't seen you since like the last time I quit BYOND. You've been hiding or something. Nice to see ya.