URL:
  <http://gna.org/bugs/?14880>

                 Summary: Client doesn't call role_unit_precalcs(), causing
errors in help
                 Project: Freeciv
            Submitted by: jtn
            Submitted on: Thursday 03/12/09 at 23:37
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
                 Release: 
         Discussion Lock: Any
        Operating System: None
         Planned Release: None

    _______________________________________________________

Details:

I spotted this due to errors in the help -- for instance, "Allows (null) to
build roads on river tiles." in help for Bridge Building, and absence of
"Allows all players with knowledge of Rocketry to build Nuclear units." from
help for Manhattan Project.

role_units_translations() was always returning NULL. Turns out that
num_role_units() was always returning 0, as its precalculated values had not
been initialised with role_unit_precalcs().

Fixed by calling role_unit_precalcs() when entering C_S_RUNNING in
set_client_state(). Not 100% sure this is the right fix, but I couldn't find
a better signal for the client having all the ruleset data. I've also added
some assertions to spot future instances of this error.

I think this may have crept in with the fix for bug #13799 (in October).

Not sure whether this could have broken anything else on the client -- not
spotted anything on a quick look.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Thursday 03/12/09 at 23:37  Name: help-null-role-unit-precalcs.diff 
Size: 2kB   By: jtn
Call role_unit_precalcs() in client; against S2_2 r16461
<http://gna.org/bugs/download.php?file_id=7437>

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  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