#44738: Split create_unit_full() in two functons Open Date: 2022-05-31 23:55 Last Update: 2022-06-06 21:54 URL for this Ticket: https://osdn.net//projects/freeciv/ticket/44738 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44738 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2022-06-06 21:54 Updated by: ihnatus Comment: Made the patches. Applied them to unit_change_owner(), removing some redundant updates, fixing the comments and making this function safe to return NULL (that it could do before). Some rebase of #44312 patches are needed. --------------------------------------------------------------------- Ticket Status: Reporter: ihnatus Owner: (None) Type: Feature Requests Status: Open Priority: 5 - Medium MileStone: 3.0.3 Component: Server Severity: 5 - Medium Resolution: None --------------------------------------------------------------------- Ticket details: For consistency, we should have an option to do separately two things that create_unit_full() does together and mixes up: Create a virtual unit, supply all necessary parameters to it and Put a preset virtual unit into the game, recording it in all the lists and structures. The downside of what is now is that in e.g. unit_change_owner() we create a unit, put it into the game and then make some raw adjustments, e.g. set its nationality and movepoints. We call AI callbacks before we do it; if now they don't interest these parameters, afterwards they may. Actually, I have in mind a pair of patches for later versions that need it, but even for 3.0 it would be better. -- 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/44738 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44738