Incidencia #41636

In use function for extra flags

Abrir Fecha: 2021-02-23 17:09 Última actualización: 2021-02-26 00:23

Informador:
Propietario:
Tipo:
Estado:
Cerrado
Componente:
Prioridad:
5 - Medium
Gravedad:
5 - Medium
Resolución:
Accepted
Fichero:
1

Details

Add the new function extra_flag_is_in_use() It checks if the specified flag is used in the current ruleset.

Ticket History (3/8 Histories)

2021-02-23 17:09 Updated by: kvilhaugsvik
  • New Ticket "In use function for extra flags" created
2021-02-23 17:11 Updated by: kvilhaugsvik
  • Resolución Update from Ninguno to Accepted
2021-02-23 18:38 Updated by: cazfi
Comentario

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()

2021-02-23 19:33 Updated by: kvilhaugsvik
Comentario

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?

2021-02-23 19:44 Updated by: cazfi
Comentario

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.

2021-02-23 20:44 Updated by: kvilhaugsvik
Comentario

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.

2021-02-26 00:23 Updated by: kvilhaugsvik
  • Estado Update from Open to Cerrado
Comentario

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.

#41651

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.

#41652

Attachment File List

Editar

Please login to add comment to this ticket » Entrar