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.
(cherry picked from commit 7f17369491
)
This commit is contained in:
parent
d3a2130b26
commit
2410535a05
1 changed files with 2 additions and 2 deletions
|
@ -124,7 +124,7 @@ resupply_commod(struct lndstr *lp, i_type type)
|
||||||
int
|
int
|
||||||
supply_commod(int own, int x, int y, i_type type, int total_wanted)
|
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 0;
|
||||||
return s_commod(own, x, y, type, total_wanted, !player->simulation);
|
return s_commod(own, x, y, type, total_wanted, !player->simulation);
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@ supply_commod(int own, int x, int y, i_type type, int total_wanted)
|
||||||
static int
|
static int
|
||||||
try_supply_commod(int own, int x, int y, i_type type, int total_wanted)
|
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 0;
|
||||||
|
|
||||||
return s_commod(own, x, y, type, total_wanted, 0);
|
return s_commod(own, x, y, type, total_wanted, 0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue