Skip to content

Commit

Permalink
Fix: loadSaveResearch should not restore "pending" bits
Browse files Browse the repository at this point in the history
These are only used for the UI in modes that use the netqueues (i.e. skirmish, etc), and only set while waiting for the netqueue to process a research action. However, savegames do not contain the netqueues, so if a save occurs between the time that the user takes a UI action (which sets the state to pending) and when the tick is processed, it could lead to research topics disappearing on saveload (since pending state is restored, but not the changes queued for the unprocessed game tick).
  • Loading branch information
past-due committed Jul 23, 2024
1 parent 2c42edf commit a6a4470
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7484,7 +7484,7 @@ bool loadSaveResearch(const char *pFileName)
psPlRes = &asPlayerResList[plr][statInc];
bool resAlreadyCompleted = IsResearchCompleted(psPlRes);
// Copy the research status
psPlRes->ResearchStatus = (researched & RESBITS_ALL);
psPlRes->ResearchStatus = (researched & RESBITS);
SetResearchPossible(psPlRes, possible);
psPlRes->currentPoints = points;
//for any research that has been completed - perform so that upgrade values are set up
Expand Down

0 comments on commit a6a4470

Please sign in to comment.