Optimize s_commod()'s harbor check for embarked land units
This commit is contained in:
parent
aef27e3521
commit
37d3846009
1 changed files with 6 additions and 7 deletions
|
@ -319,17 +319,16 @@ s_commod(struct empobj *sink, short *vec,
|
||||||
if (land.lnd_item[type] <= get_minimum(&land, type))
|
if (land.lnd_item[type] <= get_minimum(&land, type))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
getsect(land.lnd_x, land.lnd_y, §);
|
if (land.lnd_ship >= 0) {
|
||||||
|
getsect(land.lnd_x, land.lnd_y, §);
|
||||||
|
if (sect.sct_type != SCT_HARBR || sect.sct_effic < 2)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
move_cost = path_find(land.lnd_x, land.lnd_y, x, y, own, MOB_MOVE);
|
move_cost = path_find(land.lnd_x, land.lnd_y, x, y, own, MOB_MOVE);
|
||||||
if (move_cost < 0)
|
if (move_cost < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ((land.lnd_ship >= 0) && (sect.sct_type != SCT_HARBR))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if ((land.lnd_ship >= 0) && (sect.sct_effic < 2))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/*
|
/*
|
||||||
* Recursive supply is disabled for now. It can introduce
|
* Recursive supply is disabled for now. It can introduce
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue