Simplify explain()
No functional change.
This commit is contained in:
parent
696dea759c
commit
6459cfce7b
1 changed files with 7 additions and 9 deletions
|
@ -124,8 +124,7 @@ log_last_commands(void)
|
||||||
int
|
int
|
||||||
explain(void)
|
explain(void)
|
||||||
{
|
{
|
||||||
char *format;
|
struct cmndstr *com;
|
||||||
int i;
|
|
||||||
|
|
||||||
pr("\t\tCurrent EMPIRE Command List\n"
|
pr("\t\tCurrent EMPIRE Command List\n"
|
||||||
"\t\t------- ------ ------- ----\n"
|
"\t\t------- ------ ------- ----\n"
|
||||||
|
@ -139,19 +138,18 @@ explain(void)
|
||||||
" <NUM> :: a number in unspecified units\n"
|
" <NUM> :: a number in unspecified units\n"
|
||||||
" <COMM> :: a commodity such as `food', `guns', etc\n"
|
" <COMM> :: a commodity such as `food', `guns', etc\n"
|
||||||
" <TYPE> :: an item type such as `ship', `plane', etc\n");
|
" <TYPE> :: an item type such as `ship', `plane', etc\n");
|
||||||
for (i = 0; (format = player_coms[i].c_form) != 0; i++) {
|
for (com = player_coms; com->c_form; com++) {
|
||||||
if ((player_coms[i].c_permit & player->nstat)
|
if ((com->c_permit & player->nstat) == com->c_permit) {
|
||||||
== player_coms[i].c_permit) {
|
pr("%2d ", com->c_cost);
|
||||||
pr("%2d ", player_coms[i].c_cost);
|
if (com->c_permit & MONEY)
|
||||||
if ((player_coms[i].c_permit & MONEY) == MONEY)
|
|
||||||
pr("$");
|
pr("$");
|
||||||
else
|
else
|
||||||
pr(" ");
|
pr(" ");
|
||||||
if ((player_coms[i].c_permit & CAP) == CAP)
|
if (com->c_permit & CAP)
|
||||||
pr("c");
|
pr("c");
|
||||||
else
|
else
|
||||||
pr(" ");
|
pr(" ");
|
||||||
pr(" %s\n", format);
|
pr(" %s\n", com->c_form);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pr("For further info on command syntax see \"info Syntax\".\n");
|
pr("For further info on command syntax see \"info Syntax\".\n");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue