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:

  <http://gna.org/bugs/?22260>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to