Don't run supply machinery to get zero units
Change supply_commod() and try_supply_commod() not to call s_commod() when zero units are wanted. This isn't just for efficiency, it's also for limiting exposure to supply bugs a bit.
This commit is contained in:
parent
84c4ddd994
commit
7f17369491
1 changed files with 2 additions and 2 deletions
|
@ -109,7 +109,7 @@ resupply_commod(struct lndstr *lp, i_type type)
|
|||
int
|
||||
supply_commod(int own, int x, int y, i_type type, int total_wanted)
|
||||
{
|
||||
if (total_wanted < 0)
|
||||
if (total_wanted <= 0)
|
||||
return 0;
|
||||
return s_commod(own, x, y, type, total_wanted, !player->simulation);
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ supply_commod(int own, int x, int y, i_type type, int total_wanted)
|
|||
static int
|
||||
try_supply_commod(int own, int x, int y, i_type type, int total_wanted)
|
||||
{
|
||||
if (total_wanted < 0)
|
||||
if (total_wanted <= 0)
|
||||
return 0;
|
||||
|
||||
return s_commod(own, x, y, type, total_wanted, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue