New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pirating state of trade routes not saved/loaded #131
Comments
The problem is that m_piratingArmy is not saved. civctp2/ctp2_code/gs/gameobj/TradeRouteData.cpp Lines 376 to 461 in 0668dd1
You can reuse the slot of m_path_selection_state, it also occupies 32 bits like Army. So you have to replace the lines archive.PutSINT32(m_path_selection_state); by m_piratingArmy.Serialize(archive); each. Possible values for m_path_selection_state are 0, 1, and 2. Actually, it is also somewhere in the code set, but it is not used. So it shouldn't be a problem to reuse the spot. 0, 1, and 2 are not valid IDs for armies, IsValid should care about it. |
idea from @MartinGuehmann in civctp2#131
Solved with #132, many thanks @MartinGuehmann. |
Now that #127 is in, it seems that the pirating states of trade routes are not saved/loaded. E.g. when pirating in the test-game of #75, ending the turn then the trade manager shows the pirating color orange. However when saving and re-loading that game, the pirating column color is back to white.
Same holds for the action: pirating in the test-game then save and load before ending the turn will lead to no pirating for blue in the next turn.
I'd guess that the
m_piratingArmy
fromcivctp2/ctp2_code/gs/gameobj/TradeRouteData.cpp
Lines 618 to 621 in 0668dd1
is not saved, not sure about
m_isPirating
herecivctp2/ctp2_code/gs/gameobj/ArmyData.cpp
Line 508 in 0668dd1
at least allown this would not be enough since
IsBeingPirated
needsm_piratingArmy
civctp2/ctp2_code/gs/gameobj/TradeRouteData.cpp
Lines 628 to 631 in 0668dd1
@MartinGuehmann What do you think?
The text was updated successfully, but these errors were encountered: