HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. "Read more...":https://support.plan.io/news/187
Bug #853935
closedUnit built by disbanding city doesn't emit "unit_built" Lua signal
0%
Description
Noticed in passing:
In the special case where city_build_unit() disbands the city (calls disband_city()), I think the "unit_built" signal is not emitted.
Files
Updated by Jacob Nevins over 3 years ago
- File m-unit-build-script.patch m-unit-build-script.patch added
- File 30-unit-build-script.patch 30-unit-build-script.patch added
- File 26-unit-build-script.patch 26-unit-build-script.patch added
- Status changed from New to Resolved
- Assignee set to Jacob Nevins
- Sprint/Milestone set to 2.6.2
Predictably, this turned out to be a can of worms. I've fixed various other script-related issues, and also issues with rally points on master only. Master branch commit message:
Script / rally point fixes at unit build time
- A unit whose creation disbanded its city now emits the "unit_built" signal, and honours city's rally point.
- Fix trouble in city_build_stuff() if script "unit_built" or "unit_cant_be_built" handlers destroyed city.
- Fix trouble in city_build_unit() for pop_cost units if script "city_size_change" handler destroyed city.
- Fix trouble in rally point code if "unit_built" or "city_size_change" destroyed city.
The precise sequence of events around unit building has changed slightly.
Here's how the sequence of events has changed:
Before patch | After patch | |
---|---|---|
Non-disband case | create unit [city_reduce_size() => emit signal "city_size_change"] charge shield cost "Paris is finished building Warriors" ["Warriors cost 1 population"] emit signal "unit_built" |
create unit emit signal "unit_built" "Paris is finished building Warriors" (unless unit died) [city_reduce_size() => emit signal "city_size_change"] charge shield cost ["Warriors cost 1 population"] |
City disband case | create unit rehome city units "Paris is disbanded into Warriors" emit signal "city_destroyed" remove city |
create unit emit signal "unit_built" [if city still exists:] rehome city units "Paris is disbanded into Warriors" emit signal "city_destroyed" remove city |
I've tested the rally point fix and general unit building, but not the scripting fixes, beyond checking for no regressions in the tutorial scenario (which uses "unit_built").