- /*
- * military control necessary to move
- * goodies in occupied territory.
- */
- if (!istest &&
- sect.sct_oldown != player->cnum &&
- vtype != V_MILIT) {
- int tot_mil=0;
- struct nstr_item ni;
- struct lndstr land;
- snxtitem_xy(&ni, EF_LAND, sect.sct_x, sect.sct_y);
- while (nxtitem(&ni, (s_char *)&land)){
- if (land.lnd_own == player->cnum)
- tot_mil += total_mil(&land);
- }
- if ((getvar(V_MILIT, (s_char *)§, EF_SECTOR)+tot_mil) * 10
- < getvar(V_CIVIL, (s_char *)§, EF_SECTOR)) {
- pr("Military control required to move goods.\n");
- return RET_FAIL;
- }
- }
- stype = sect.sct_type;
- dp = &dchr[stype];
- infected = getvar(V_PSTAGE, (s_char *)§, EF_SECTOR) == PLG_INFECT;
- amt_src = getvar(vtype, (s_char *)§, EF_SECTOR);
- if (!istest && amt_src <= 0) {
- pr("No %s in %s\n", ip->i_name,
- xyas(sect.sct_x, sect.sct_y, player->cnum));
- return RET_FAIL;
- }
- own = sect.sct_own;
- mob = (int)sect.sct_mobil;
- if (!istest && vtype == V_CIVIL && sect.sct_oldown != own) {
- pr("You can't move conquered populace!\n");
- return RET_FAIL;
- }
- if (mob <= 0) {
- pr("No mobility in %s\n",
- xyas(sect.sct_x, sect.sct_y, player->cnum));
- return RET_SYN;
- }
- if (vtype == V_CIVIL) {
- work = sect.sct_work;
- if (work != 100)
- pr("Warning: civil unrest\n");
- loyal = sect.sct_loyal;
- } else if (vtype == V_MILIT) {
- work = 100;
- loyal = 0;
- }
- if (istest)
- sprintf(prompt, "Number of %s to test move? ", ip->i_name);
- else
- sprintf(prompt, "Number of %s to move? (max %d) ",
- ip->i_name,
- amt_src);
- if ((amount = onearg(player->argp[3], prompt)) < 0)
- return RET_FAIL;
- if (!check_sect_ok(§))