-
Notifications
You must be signed in to change notification settings - Fork 36
Description
I've been looking through the monthly JSON summaries, and I think there is a bug. For example, if you look at 4pLeague_S35_D1L1_G1 from 2020-03.json, you'll see that there are two events as turn one for one faction in each round. The darklings, for example, have both upgrade:TP and upgrade:TE marked with turn{1}{1} = 1.
It appears that the faction that moves first in each round has all of their events except the first one tallied with a turn number one less than it should be (i.e. all the events for the darklings in round 1 have a turn number one too small, except for their first turn; all the events for the engineers in round 2 have a turn number one too small, except for their first turn; etc.).
I poked around in the code for a while, but I couldn't figure out what the problem is. I am suspicious of the code around maybe_advance_to_next_player in acting.pm, where start_full_move($next) maybe_advance_turn($faction, $next) are called before finish_row() is called. Because the events are logged with the turn in effect when the command is executed, but then the row is stored to the ledger with the turn after maybe_advance_turn() is called. But it seems like that would make things wrong in the other direction - that the last player in each turn would get the event logged in the proper turn and then the ledger row would be in n+1. But presumably that would get caught very quickly. So maybe that was a problem and there is some fixup somewhere else that exposed this other problem, which nobody cares about!
I looked through the commit log for a while to see if I could find a commit that had something to do with this, and I looked through the closed issues, but I couldn't find anything related. It didn't look very simple to set up a local environment, so I didn't really get any further.
Happy to dig in more if there are instructions for setting up a developer environment that I missed.