#44216: Lua: missing destructors Open Date: 2022-03-27 22:11 Last Update: 2022-03-28 23:38 URL for this Ticket: https://osdn.net//projects/freeciv/ticket/44216 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44216 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2022-03-28 23:38 Updated by: cazfi Comment: Reply To ihnatus a city may already be destroyed indirectly by a unit action That's a very valid point about the city removal method. I don't think I've ever read through the player *removal* code, so won't say anything too final about that part yet. I know that we've never had player's *death* handled (invalidating any data structures, iterators) mid-turn, but at most flagging it in 'is_alive' to be handled in the next turn change. --------------------------------------------------------------------- Ticket Status: Reporter: ihnatus Owner: (None) Type: Feature Requests Status: Open Priority: 5 - Medium MileStone: S3_1 d3f Component: Scripting API Severity: 5 - Medium Resolution: None --------------------------------------------------------------------- Ticket details: Since #42501 is going to be postponed to 3.2, I request separately a thing that should for better go to S3_1: ways to destroy/inactivate game objects. Player:lose(Player winner?, LuaValue loot?) - does mostly the same as killing a king, optionally gives loot (if not ruleset standard one, specified like in game.ruleset:civstyle.gameloss_style) to winner. Player:remove() - works as /remove command City:destroy() - destroys a city. Maybe needs some parameters like what to do with upkept units. -- 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/44216 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44216