Skip to content

Commit

Permalink
Never add completed researches to research menu.
Browse files Browse the repository at this point in the history
Researches would fail to disappear from the research menu when the research was complete, if clicking on the
research facility just before the research was complete, since this resulted in setting the research to pending,
and the research would still be pending even after being complete (more likely with high latency, due to a larger
window to reproduce in).

Fixes ticket:3454.
  • Loading branch information
Cyp committed Sep 15, 2012
1 parent 594b8a6 commit d37f527
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hci.cpp
Expand Up @@ -5436,7 +5436,7 @@ static BASE_STATS *getResearchStats(BASE_OBJECT *psObj)
psBuilding = (STRUCTURE *)psObj;
psResearchFacility = &psBuilding->pFunctionality->researchFacility;

if (psResearchFacility->psSubjectPending != NULL)
if (psResearchFacility->psSubjectPending != NULL && !IsResearchCompleted(&asPlayerResList[psObj->player][psResearchFacility->psSubjectPending->index]))
{
return psResearchFacility->psSubjectPending;
}
Expand Down

0 comments on commit d37f527

Please sign in to comment.