URL:
<http://gna.org/bugs/?21418>
Summary: Ruleset loading requirement validity check relies on
information not yet loaded
Project: Freeciv
Submitted by: jtn
Submitted on: Fri Jan 3 00:44:45 2014
Category: None
Severity: 3 - Normal
Priority: 5 - Normal
Status: In Progress
Assigned to: jtn
Originator Email:
Open/Closed: Open
Release:
Discussion Lock: Any
Operating System: None
Planned Release:
_______________________________________________________
Details:
In req_from_str(), some validity checking is done on the requirement,
particularly whether its range is appropriate for its type.
In the case of VUT_IMPROVEMENT, the valid ranges depend on whether it's a
wonder or not. Unfortunately, the information checked here is not guaranteed
to have been loaded yet; req_from_str() is called during ruleset loading, and
depending on context, some or all improvements may not have been read yet.
It's been like that since this code was added
([http://svn.gna.org/viewcvs/freeciv?revision=10269&view=revision r10269,
PR#12823, 2005-04).
In my testing, the checks seemed to pass incorrectly, probably because
IG_GREAT_WONDER == 0 and the improvement data structures are statically
allocated and hence zeroed. However, I suspect that if a ruleset is loaded a
second time, this check could spuriously fail a valid ruleset.
Probably this check needs to be deferred to sanity_check_ruleset_data(), once
all the data is loaded.
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?21418>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev