Optimize dodistribute() for sectors with no distribution center
import_cost is now -1 in that case, so checking that suffices.
This commit is contained in:
parent
f4db4e37b1
commit
b8002d5603
1 changed files with 1 additions and 4 deletions
|
@ -70,9 +70,6 @@ dodistribute(struct sctstr *sp, int imex, double import_cost)
|
|||
int rplague;
|
||||
int lplague;
|
||||
|
||||
if ((sp->sct_dist_x == sp->sct_x) && (sp->sct_dist_y == sp->sct_y))
|
||||
return 0;
|
||||
|
||||
if (imex == IMPORT && import_cost < 0.0)
|
||||
return 0;
|
||||
|
||||
|
@ -82,7 +79,7 @@ dodistribute(struct sctstr *sp, int imex, double import_cost)
|
|||
else {
|
||||
dcc = sector_mcost(dist, MOB_MOVE);
|
||||
if (import_cost < 0.0 || dcc < 0.0) {
|
||||
if (sp->sct_own != 0)
|
||||
if (sp->sct_own && sp->sct_uid != dist->sct_uid)
|
||||
wu(0, sp->sct_own, "No path to dist sector for %s\n",
|
||||
ownxy(sp));
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue