Update of bug #22260 (project freeciv):
Status: Ready For Test => None
Planned Release: 2.5.0, 2.6.0 =>
Follow-up Comment #2:
Initialisation is done by trickery: dai_player_alloc() uses fc_calloc() to
initialise the structure which contains the tech_wants array. fc_calloc()
calls fc_real_calloc(), which then calls memset(ptr, 0, size). As a result,
when the player is initialised, the structure discovers all the tech_want
values to be zero.
Making this explicit would probably be more developer friendly.
That said, unless I'm missing something with my reading of the code, this
means that tech wants grow infinitely, so may need bounds checking. I suspect
that infinite growth (if bounded) is the correct strategy, as it means that if
the AI has wanted something a little bit for a long time, it might choose that
over something it happens to want a lot today (but didn't want before, and
might not want later).
Reply to this item at:
Message sent via/by Gna!
Freeciv-dev mailing list