Skip to content

Commit

Permalink
Fix another research cancellation not registering in UI.
Browse files Browse the repository at this point in the history
If cancelling a research by clicking on the current research, in the research menu (not
right-clicking on the facility), then the next completed research in the same facility
would linger after completion.

Research is cancelled twice when clicking on the current research, but was incorrectly
registered as cancelling three times, confusing the facility. Also, when cancelling, the
second cancellation would fail to be registered, due to the ID of the research facility
not being sent.

Fixes ticket:3130.
  • Loading branch information
Cyp committed Feb 6, 2012
1 parent a271286 commit ae59186
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/hci.cpp
Expand Up @@ -2591,6 +2591,7 @@ static void intProcessStats(UDWORD id)
{
if (psObjSelected->type == OBJ_STRUCTURE )
{
// TODO This call seems to be redundant, since cancelResearch is called from objSetStatsFunc==setResearchStats.
cancelResearch((STRUCTURE *)psObjSelected, ModeQueue);
}
}
Expand Down Expand Up @@ -5422,7 +5423,6 @@ static bool setResearchStats(BASE_OBJECT *psObj, BASE_STATS *psStats)
else
{
cancelResearch(psBuilding, ModeQueue);
setStatusPendingCancel(*psResFacilty);
}
//stop the button from flashing once a topic has been chosen
stopReticuleButtonFlash(IDRET_RESEARCH);
Expand Down
2 changes: 1 addition & 1 deletion src/research.cpp
Expand Up @@ -1338,7 +1338,7 @@ void cancelResearch(STRUCTURE *psBuilding, QUEUE_MODE mode)
if (mode == ModeQueue)
{
// Tell others that we want to stop researching something.
sendResearchStatus(NULL, topicInc, psBuilding->player, false);
sendResearchStatus(psBuilding, topicInc, psBuilding->player, false);
// Immediately tell the UI that we can research this now. (But don't change the game state.)
MakeResearchCancelledPending(pPlayerRes);
setStatusPendingCancel(*psResFac);
Expand Down

0 comments on commit ae59186

Please sign in to comment.