A 3.0 patch is ready, it works for simple cases, though really nasty callbacks I could write still fail due to code out of scope (specifically, clearing of vision in server_remove_unit() before calling a callback that makes it not recursive); some changes done in previous patches in HRM849859 and #44312 are needed for it but the patches theselves should be modified to apply over or beneath this one.
Prepared a 3.1 patch. It probably should apply to 3.2 but maybe we should rewrite 3.2 unit_change_owner() completely by HRM874201.
Reply To ihnatus
Prepared a 3.1 patch. It probably should apply to 3.2
Yes, it applies to master too.
---
- non_allied_not_listed_at() header begins with:
/*******************************************************************//*****
There should be no "*//*" part in S3_0, and in later branches it should be almost in the end of the line - unify with the other headers in the same source file (they are not unified over different source files)
- First line of the commit message should be one line summary (that shows up as heading in various places) followed by one empty line, and the full description after that. I've been adjusting the commit messages anyway, but less I need to do that, the better.
Fixed. Also, added a notice on stdout (not shown to the players) if the gold is underflown.
Reply To ihnatus
Fixed. Also, added a notice on stdout (not shown to the players) if the gold is underflown.
Clarification: This is freeciv logging (like it should), and not necessarily stdout.
A split of #44738.
It should be handled that this function sometimes does not give out a unit due to the callback in wipe_init(). In do_capture_units() stack iteration must be safe. Also, in diplomat_bribe() we should avoid getting into negative gold (what's the alternative?..)