Follow-up Comment #4, patch #3829 (project freeciv):
Err, rather, the code is just confusing: suggestions for comments to avoid
confusing future readers welcome.
Rulesets add compatible roads to the integrates vector.
load_ruleset_terrain():
Adds road being loaded to the (server-side) integrators list
Adds any road in the integrates INI vector to the (server-side)
integrators list
Sets a bitvector to match the INI vector for integrates
packets.def: sends the integrates bitvector
handle_rulesets_ready():
Adds road being processed to the (client-side) integrators list
Adds any roads in the integrates bitvector to the (client-side)
integrators list
tile_move_cost_ptrs():
Iterates over the integrators list when checking roads.
So, for both client and server, every road always integrates with itself,
regardless of the notation in the ruleset. Further, the identical road is
always first in the integrators list, so that continuation on the same road is
checked first when calculating move cost (which is expected to be the most
common case, and for fast roads, the lowest cost (important as movement over
fast roads requires the greatest number of calls to tile_move_cost_ptrs).
Therefore, the originally submitted patch should be fine to process (unless
something else is discovered in testing). That said, perhaps "integrates" and
"integrators" need greater differentiation to reduce confusion, or, as noted
above, perhaps the code needs more comments.
_______________________________________________________
Reply to this item at:
<http://gna.org/patch/?3829>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev