#47292: Unit counters framework Open Date: 2023-02-03 03:25 Last Update: 2023-05-26 22:10 URL for this Ticket: https://osdn.net//projects/freeciv/ticket/47292 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=47292 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2023-05-26 22:10 Updated by: lachu Comment: Reply To cazfi - Patch does not apply (any more?) - Missing ruleset documentation about "target" field - Following check is not strict enough. What if target was given as "blabla"? Even in compat mode, we should only accept the case where the "target" is completely missing: {{{ if (!counter_target_is_valid(ct)) { ... + if (compat->version > RSFORMAT_3_2) { + ruleset_error(NULL, LOG_ERROR, + "\"%s\" unknown counter target \"%s\".", + filename, counter_type); + ok = FALSE; + break; + } + ct = CTGT_CITY; } > 0001-OSDN-47292-S-awomir-Lach-slawek-lach.art.pl.patch(8KB) It should now working. Documentation changes will be placed in next patch. 0001-OSDN-47292-S-awomir-Lach-slawek-lach.art.pl.patch(8KB) Documentation --------------------------------------------------------------------- Ticket Status: Reporter: cazfi Owner: (None) Type: Patches Status: Open Priority: 5 - Medium MileStone: 3.3.0 Component: General Severity: 5 - Medium Resolution: None --------------------------------------------------------------------- Ticket details: Add initial support for unit counters. No need to implement any counter behavior in this ticket - current counters code should be flexible enough to work (iterate over) zero counter behaviors and counter instances. --- - Add counter_target type "Unit" - Add counters_get_unit_counters_count() - Implement unit_counters_iterate(pcount) macro (mostly by copying ciyt_counters_iterate() and modifying a bit) - Add "counter_values" to unit structure Savegame part likely isn't as trivial "copy from city counters implementation" -> let's leave that to another ticket. -- Ticket information of Freeciv project Freeciv Project is hosted on OSDN Project URL: https://osdn.net/projects/freeciv/ OSDN: https://osdn.net URL for this Ticket: https://osdn.net/projects/freeciv/ticket/47292 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=47292