Summary: Ensure use of boolean TRUE/FALSE in reqs
                 Project: Freeciv
            Submitted by: persia
            Submitted on: Tue 09 Apr 2013 03:34:15 AM JST
                Category: rulesets
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 



    For the boolean values "survives" and "negated", the ruleset format used
to accept 0 and 1.  This has been changed so that TRUE and FALSE are expected.
 This patch ensures that values detected as integers will raise a ruleset
error, rather than silently defaulting to FALSE (possibly changing gameplay
behaviour for insufficiently transitioned rulesets).

    Note that this uses considerably lower-level secfile access, and has some
duplicated logic.  In the event that there was more of this that needed doing,
it may be worth considering implementing it by passing an address to
secfile_lookup_bool_default(), and using the return value as an indicator of
whether the returned value was default because the entry was missing or
whether it was default because the content of the entry wasn't boolean.  That
said, the fact that the file format *can* support integers masquerading as
booleans might make that less usefully general with such specialisation: I
leave further speculation to anyone who wants to refactor the check to use a
shared function.

    This should be a dependency of patch #1449 , but I can't figure out how to
make that true from the GNA interface: if someone would be willing to so mark
it, I would appreciate that.


File Attachments:

Date: Tue 09 Apr 2013 03:34:15 AM JST  Name:
validate-survives-negated-req-values.patch  Size: 2kB   By: persia



Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to