Skip to content

Commit

Permalink
Ignore JS reticule function requests during game over.
Browse files Browse the repository at this point in the history
If rules.js were to change a reticule stat during the results screen
being active then a crash would occur.

Closes ticket 4718.
  • Loading branch information
KJeff01 committed Jun 30, 2018
1 parent e9b67a4 commit 6f9a69d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/hci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,10 @@ static RETBUTSTATS retbutstats[NUMRETBUTS];

void setReticuleFlash(int ButId, bool flash)
{
if (MissionResUp)
{
return;
}
if (flash != retbutstats[ButId].flashing)
{
retbutstats[ButId].flashing = flash;
Expand All @@ -386,6 +390,11 @@ void setReticuleFlash(int ButId, bool flash)

void setReticuleStats(int ButId, std::string tip, std::string filename, std::string filenameDown, WzString func, QScriptEngine *engine)
{
if (MissionResUp)
{
return;
}

retbutstats[ButId].tip = tip;
retbutstats[ButId].filename = WzString::fromUtf8(filename.c_str());
retbutstats[ButId].filenameDown = WzString::fromUtf8(filenameDown.c_str());
Expand Down

0 comments on commit 6f9a69d

Please sign in to comment.