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
         Discussion Lock: Any
        Operating System: None
         Planned Release: None



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


Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to