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...
Middle-click tile popup very confused in rulesets where multiple activities can create/remove a single extra
(This patch is really a refactor on the way to solving bug #861460, but on the way I found what is arguably an actual bug, albeit a rather obscure one.)
It's possible for a ruleset to have two separate activities that are valid simultaneously to cause the creation or removal of a particular extra, say (um) irrigation and mining both producing an Artesian Well extra. If the activities take different times, the actual behaviour is that the two activities proceed independently in parallel, and the first one to complete wins (and units doing the slower activity stop it afterward, since it's no longer valid).
However, if such activities are happening simultaneously on a tile, the middle-click tile info popup erroneously pools activity points from the two activities together in a confusing way, often showing completion times that correspond to neither activity, and activities that are not occurring.This patch will change
concat_tile_activity_text()to keep track of progress per-extra and per-activity, to fix this. Also, it will:
- Stop allocating big arrays on the stack (with this change the allocation was going to be something like tens of kilobytes)
- Split out the calculation into a separate function (as I am about to need it for something else)
The effect is that the tile popup will display the two activities separately, with correct completion times. It makes no attempt to signal that one activity is going to make the other one moot.
#1 Updated by Jacob Nevins 11 months ago
- File 26-classic-multicause.diff 26-classic-multicause.diff added
- File 26_multicause.sav.bz2 26_multicause.sav.bz2 added
(My initial example was "Clean Pollution" and "Pillage" both removing the Pollution extra, but I ran into bug #861508.)
Attached ruleset diff / savegame allows for exploring the behaviour.