Remove unreachable code in sell()
sell used to search multiple sectors for sellable commodities, keeping tally in totalcom. It failed with message "No eligible" when none could be found. sell's second argument got changed to a single sector in Empire 3. If the sector can't sell, we return early. Else, totalcom is positive. Thus, the "No eligible" code is unreachable. Remove it.
This commit is contained in:
parent
845fc9eb56
commit
11d6e8ce80
1 changed files with 19 additions and 23 deletions
|
@ -136,7 +136,7 @@ sell(void)
|
||||||
xyas(sect.sct_x, sect.sct_y, player->cnum), amt);
|
xyas(sect.sct_x, sect.sct_y, player->cnum), amt);
|
||||||
sect.sct_item[ip->i_uid] = amt;
|
sect.sct_item[ip->i_uid] = amt;
|
||||||
putsect(§);
|
putsect(§);
|
||||||
if (totalcom > 0) {
|
|
||||||
for (ii = 0; getcomm(ii, &comm); ii++) {
|
for (ii = 0; getcomm(ii, &comm); ii++) {
|
||||||
if (comm.com_owner == 0)
|
if (comm.com_owner == 0)
|
||||||
break;
|
break;
|
||||||
|
@ -157,9 +157,5 @@ sell(void)
|
||||||
pr("Problems with the commodities file, call the Deity\n");
|
pr("Problems with the commodities file, call the Deity\n");
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
pr("No eligible %s for sale\n", ip->i_name);
|
|
||||||
return RET_FAIL;
|
|
||||||
}
|
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue