Created attachment 1350[details]
ClientCommand (first try)
This patch is entirely untested, but it does compile. Some of the stuff should be moved around a little for a final version of this.
This changes all Cmd_*_f commands to accept only a single arg. Some functions
had to be modified to work without extra args.
This does a couple extra things:
* Cmd_Follow_f should not be used elsewhere for toggling. A new function,
G_ToggleFollow, was added for that. /toggle without any arguments still
functions the same.
* CheatsOk was removed. This check is done in ClientCommand.
* I removed the distinction between /destroy and /deconstruct. Since /destroy
can only be used with cheats enabled, I figure it should probably be entirely
removed. (I kept it because the function is called Cmd_Destroy_f.)
What was the arg0 stuff in Cmd_Say_f for? It wasn't used and didn't look useful,
so I removed it.
I forgot to mention that I removed the /test command (didn't do anything anyway).
I also just noticed that I reversed /ignore and /unignore. It should be:
ignore = !Q_stricmp( cmd, "ignore" );
(the '!' was missing).
I should also make /follow(next|prev) consistent with /say(_team)?:
int dir = 1;
...
if( Q_stricmp( args, "follownext" ) )
dir = -1
(after all, ternary conditions are usually really ugly -- that one is no exception)
Any other problems?
Created attachment 1357[details]
ClientCommand (second try)
Updated for revision 940. Fixed the issues in comment #2.
Made the "give_all" test in Cmd_Give_f consistent as well.
Removed the PTE_NONE (else) condition from Cmd_CallTeamVote_f and Cmd_TeamVote_f and avoided a stupid gcc warning.
Removed the PTE_NONE condition from Cmd_Class_f.
ScoreboardMessage is used instead of Cmd_Score_f (since that's all Cmd_Score_f did anyway).
I think this is at least in a test-worthy state ;-) Also, any other redundant tests that can be removed would be nice.
Created attachment 1377[details]
ClientCommand (third try)
Minor update:
* Changes all Cmd_Score_f to ScoreboardMessage
* Properly returns if an admin command is used
Created attachment 1405[details]
ClientCommand (fourth)
Changes the names for a couple flags and moves stuff where it should probably be.
Anything else that needs changing?
Created attachment 1350 [details] ClientCommand (first try) This patch is entirely untested, but it does compile. Some of the stuff should be moved around a little for a final version of this. This changes all Cmd_*_f commands to accept only a single arg. Some functions had to be modified to work without extra args. This does a couple extra things: * Cmd_Follow_f should not be used elsewhere for toggling. A new function, G_ToggleFollow, was added for that. /toggle without any arguments still functions the same. * CheatsOk was removed. This check is done in ClientCommand. * I removed the distinction between /destroy and /deconstruct. Since /destroy can only be used with cheats enabled, I figure it should probably be entirely removed. (I kept it because the function is called Cmd_Destroy_f.) What was the arg0 stuff in Cmd_Say_f for? It wasn't used and didn't look useful, so I removed it.
Created attachment 1377 [details] ClientCommand (third try) Minor update: * Changes all Cmd_Score_f to ScoreboardMessage * Properly returns if an admin command is used
Created attachment 1405 [details] ClientCommand (fourth) Changes the names for a couple flags and moves stuff where it should probably be. Anything else that needs changing?