From: Markus Armbruster Date: Tue, 24 Aug 2004 07:08:59 +0000 (+0000) Subject: (move, explore): Simplify computation of destination sector's work and X-Git-Tag: v4.2.18~40 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=01e7ea7916aca2ba0eebe70bd0822667835c61a6 (move, explore): Simplify computation of destination sector's work and loyalty to get rid of compiler warnings. --- diff --git a/src/lib/commands/expl.c b/src/lib/commands/expl.c index 51566f5db..ae2905336 100644 --- a/src/lib/commands/expl.c +++ b/src/lib/commands/expl.c @@ -103,15 +103,13 @@ explore(void) xyas(sect.sct_x, sect.sct_y, player->cnum)); return RET_SYN; } - if (vtype == I_CIVIL) { - work = sect.sct_work; - if (work != 100) - pr("Warning: civil unrest\n"); - loyal = sect.sct_loyal; - } else if (vtype == I_MILIT) { - work = 100; - loyal = 0; - } + + /* only used when moving civs; but prevent spurious compiler warnings */ + work = sect.sct_work; + loyal = sect.sct_loyal; + if (vtype == I_CIVIL && work != 100) + pr("Warning: civil unrest\n"); + sprintf(prompt, "Number of %s to explore with? (max %d) ", ip->i_name, amt_src); amount = onearg(player->argp[3], prompt); @@ -223,8 +221,8 @@ explore(void) takeover(§, player->cnum); justtook = 1; sect.sct_oldown = own; - sect.sct_work = work; - sect.sct_loyal = loyal; + sect.sct_work = 100; + sect.sct_loyal = 0; } if (vtype == I_CIVIL && sect.sct_oldown != player->cnum) { pr("Your civilians don't want to stay!\n"); diff --git a/src/lib/commands/move.c b/src/lib/commands/move.c index fec474d8b..92dbfbd5e 100644 --- a/src/lib/commands/move.c +++ b/src/lib/commands/move.c @@ -120,15 +120,13 @@ move(void) xyas(sect.sct_x, sect.sct_y, player->cnum)); return RET_SYN; } - if (vtype == I_CIVIL) { - work = sect.sct_work; - if (work != 100) - pr("Warning: civil unrest\n"); - loyal = sect.sct_loyal; - } else if (vtype == I_MILIT) { - work = 100; - loyal = 0; - } + + /* only used when moving civs; but prevent spurious compiler warnings */ + work = sect.sct_work; + loyal = sect.sct_loyal; + if (vtype == I_CIVIL && work != 100) + pr("Warning: civil unrest\n"); + if (istest) sprintf(prompt, "Number of %s to test move? ", ip->i_name); else