raduprv / Eternal-Lands

http://www.eternal-lands.com
Other
159 stars 57 forks source link

De-duplicate comand parsing code #10

Closed eponymous closed 11 years ago

eponymous commented 11 years ago

Removes some duplicated code and uses only parse_input() to parse the command input.

Note: not sure if "@@ foo" is meant to be supported in all windows so left the code checking for that where it was in gamewin.c.

pjbroad commented 11 years ago

Thanks, I can't see why "@@ foo" should not be in parse_input too. I'll investigate a bit more and make that change too.

pjbroad commented 11 years ago

Looks like that code is never reached anyway unless we have lost the input widget. The common parse_input() function is used in the root_key_to_input_field() call at the top of the function. The additional check for "@@" just switches your default channel to the one specified then sends the text. IMHO, I'd rather the default channel was left as it was if I'm using "@@". Otherwise, I'd just switch default channels and use "@". I'm thinking to just remove that code....