Update of bug #21199 (project freeciv):
Planned Release: 2.3.5, 2.4.1, 2.5.0, 2.6.0 => 2.5.0, 2.6.0
Follow-up Comment #2:
Dropping stable branches as fixing this seems to require big rearrangements on
ai unit initialization and closing.
- Bug's impact is rather small as stats will be recalculated next turn anyway
- it only causes some extra problems for ais during civil war
- While we have not announced freeze for ai callback interface, I'd rather not
change it for S2_4 now that 2.4.0 is out
- Fix has rather high risk of introducing/exposing other bugs, maybe worse
About the problem:
- Ferries are removed from stats in "unit_close" -callback, but are not
symmetrically added in "unit_alloc" -callback. "unit_close" is called only
when unit is completely destroyed.
- Unit's are added in "unit_created" -callback that has no equivalent
unit_destroyed callback at all. The callback exist only as (broken) hack to
provide ferry stats update at the right time
- I think ferry stats updates should be in "unit_got" and "unit_lost"
-callbacks so they would apply to unit owner changes as well as unit
- The reason "unit_created" is currently used instead of "unit_got" is that
when unit is first created, "unit_got" gets called from common code before
server has initialized its part of the unit
- "unit_got" and "unit_lost" -callbacks should be moved from common code to
server side, so they would always be called when unit is in sane state (they
are when they are called for unit bribe or other owner changes)
- As "unit_got" would be called where "unit_created" is now called, latter
should be removed as obsolete
Reply to this item at:
Message sent via/by Gna!
Freeciv-dev mailing list