(move, explore): Simplify computation of destination sector's work and
loyalty to get rid of compiler warnings.
This commit is contained in:
parent
c06b330426
commit
01e7ea7916
2 changed files with 16 additions and 20 deletions
|
@ -103,15 +103,13 @@ explore(void)
|
||||||
xyas(sect.sct_x, sect.sct_y, player->cnum));
|
xyas(sect.sct_x, sect.sct_y, player->cnum));
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
}
|
}
|
||||||
if (vtype == I_CIVIL) {
|
|
||||||
work = sect.sct_work;
|
/* only used when moving civs; but prevent spurious compiler warnings */
|
||||||
if (work != 100)
|
work = sect.sct_work;
|
||||||
pr("Warning: civil unrest\n");
|
loyal = sect.sct_loyal;
|
||||||
loyal = sect.sct_loyal;
|
if (vtype == I_CIVIL && work != 100)
|
||||||
} else if (vtype == I_MILIT) {
|
pr("Warning: civil unrest\n");
|
||||||
work = 100;
|
|
||||||
loyal = 0;
|
|
||||||
}
|
|
||||||
sprintf(prompt, "Number of %s to explore with? (max %d) ",
|
sprintf(prompt, "Number of %s to explore with? (max %d) ",
|
||||||
ip->i_name, amt_src);
|
ip->i_name, amt_src);
|
||||||
amount = onearg(player->argp[3], prompt);
|
amount = onearg(player->argp[3], prompt);
|
||||||
|
@ -223,8 +221,8 @@ explore(void)
|
||||||
takeover(§, player->cnum);
|
takeover(§, player->cnum);
|
||||||
justtook = 1;
|
justtook = 1;
|
||||||
sect.sct_oldown = own;
|
sect.sct_oldown = own;
|
||||||
sect.sct_work = work;
|
sect.sct_work = 100;
|
||||||
sect.sct_loyal = loyal;
|
sect.sct_loyal = 0;
|
||||||
}
|
}
|
||||||
if (vtype == I_CIVIL && sect.sct_oldown != player->cnum) {
|
if (vtype == I_CIVIL && sect.sct_oldown != player->cnum) {
|
||||||
pr("Your civilians don't want to stay!\n");
|
pr("Your civilians don't want to stay!\n");
|
||||||
|
|
|
@ -120,15 +120,13 @@ move(void)
|
||||||
xyas(sect.sct_x, sect.sct_y, player->cnum));
|
xyas(sect.sct_x, sect.sct_y, player->cnum));
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
}
|
}
|
||||||
if (vtype == I_CIVIL) {
|
|
||||||
work = sect.sct_work;
|
/* only used when moving civs; but prevent spurious compiler warnings */
|
||||||
if (work != 100)
|
work = sect.sct_work;
|
||||||
pr("Warning: civil unrest\n");
|
loyal = sect.sct_loyal;
|
||||||
loyal = sect.sct_loyal;
|
if (vtype == I_CIVIL && work != 100)
|
||||||
} else if (vtype == I_MILIT) {
|
pr("Warning: civil unrest\n");
|
||||||
work = 100;
|
|
||||||
loyal = 0;
|
|
||||||
}
|
|
||||||
if (istest)
|
if (istest)
|
||||||
sprintf(prompt, "Number of %s to test move? ", ip->i_name);
|
sprintf(prompt, "Number of %s to test move? ", ip->i_name);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue