In use function for extra flags
Do you need this outside ruledit? If I were to search for such a function from freeciv codebase, I would assume it to be in tools/ruledit/validity.ch, and named is_extra_flag_needed()
Reply To cazfi
Do you need this outside ruledit?
I need it for universal_never_there() that lives in common. universal_never_there() could - if I remember correctly - move to the server if we don't care about special handling for rulesets that requires a universal that isn't there in autohelp and other client code that reasons about requirements. The only existing handling of that kind I recall right now is how action_is_in_use() is used by autohelp to check if all units are immune to an action because the action isn't enabled and therefore shouldn't be documented. It can move to ruledit if we - going by memory again here - don't want the option to clean the updated ruleset as a part of ruleset upgrade. This isn't done at the moment.
In case it living in common is OK for you: Do you want something in tools/ruledit/validity for ruledit?
If you are implementing functionality like that to server, you may need functions already existing in validity.c -> maybe we should move it to common or server? If I recall correctly, it has no dependencies to other ruledit, or even tools, code. OTOH I'm not sure I'm a fan of ruleset update purging my WIP/temporarily disabled rules only because they have not been "attached" to anything in their current version.
Reply To cazfi
OTOH I'm not sure I'm a fan of ruleset update purging my WIP/temporarily disabled rules only because they have not been "attached" to anything in their current version.
In that case I won't add it to ruleset update (rscompat) but keep it as an option for ruleup. Would you like ruleup to be dirty by default rather than clean by default?
I could also move the purging of non enabled actions from lists from rulesave to the ruleset purging code or make it configurable in some other way.
Reply To kvilhaugsvik
I could also move the purging of non enabled actions from lists from rulesave to the ruleset purging code or make it configurable in some other way.
Reply To cazfi
If you are implementing functionality like that to server, you may need functions already existing in validity.c -> maybe we should move it to common or server? If I recall correctly, it has no dependencies to other ruledit, or even tools, code.
Add the new function extra_flag_is_in_use() It checks if the specified flag is used in the current ruleset.