#46563: Replace action_target_compl_calc() switch with a table Open Date: 2023-01-21 08:00 Last Update: 2023-01-21 08:06 URL for this Ticket: https://osdn.net//projects/freeciv/ticket/46563 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=46563 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2023-01-21 08:06 Updated by: cazfi * Owner Update from (None) to cazfi * Resolution Update from None to Accepted --------------------------------------------------------------------- Ticket Status: Reporter: cazfi Owner: cazfi Type: Patches Status: Open [Owner assigned] Priority: 5 - Medium MileStone: 3.2.0 Component: General Severity: 5 - Medium Resolution: Accepted --------------------------------------------------------------------- Ticket details: - Add struct actres - Make array of them to hold information about every actres - Make act_tgt_compl the first field of the strcuct actres - Replace large switch in action_target_compl_calc() with indexed lookup from the actres array - This is natural opportunity to start splitting new actres.[ch] module from actions.[ch] -> have the array and the new implementation of action_target_compl_calc() in the new module -- 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/46563 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=46563