Skip to content

Commit

Permalink
fix bingo win with inventory open crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Die4Ever committed Sep 7, 2023
1 parent 075f831 commit cee2f0f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 31 deletions.
28 changes: 28 additions & 0 deletions DXRCore/DeusEx/Classes/DXRBase.uc
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,34 @@ simulated function MessageBoxClicked(int button, int callbackId) {
//OK = 2
}

//Returns true when you aren't in a menu, or in the intro, etc.
function bool InGame() {
#ifdef hx
return true;
#endif

if( player() == None )
return false;

if (player().InConversation()) {
return True;
}

if (None == DeusExRootWindow(player().rootWindow)) {
return False;
}

if (None == DeusExRootWindow(player().rootWindow).hud) {
return False;
}

if (!DeusExRootWindow(player().rootWindow).hud.isVisible()){
return False;
}

return True;
}

simulated function AddDXRCredits(CreditsWindow cw)
{
}
9 changes: 6 additions & 3 deletions DXRModules/DeusEx/Classes/DXREvents.uc
Original file line number Diff line number Diff line change
Expand Up @@ -1196,9 +1196,12 @@ function BingoWinScreen()
p.ReducedDamageType = 'All';// god mode
p.DesiredFlashScale = 0;
p.DesiredFlashFog = vect(0,0,0);
p.ShowHud(False);
//Show win message
class'DXRBigMessage'.static.CreateBigMessage(dxr.player,None,"Congratulations! You finished your bingo!","Game ending in "$bingo_win_countdown$" seconds");

if(InGame()) {
p.ShowHud(False);
//Show win message
class'DXRBigMessage'.static.CreateBigMessage(dxr.player,None,"Congratulations! You finished your bingo!","Game ending in "$bingo_win_countdown$" seconds");
}
if (bingo_win_countdown == 2 && !#defined(vanilla)) {
//Give it 2 seconds to send the tweet
//This is still needed outside of vanilla
Expand Down
28 changes: 0 additions & 28 deletions DXRModules/DeusEx/Classes/DXRStats.uc
Original file line number Diff line number Diff line change
Expand Up @@ -48,34 +48,6 @@ simulated function ReEntry(bool IsTravel)
}
}

//Returns true when you aren't in a menu, or in the intro, etc.
function bool InGame() {
#ifdef hx
return true;
#endif

if( player() == None )
return false;

if (player().InConversation()) {
return True;
}

if (None == DeusExRootWindow(player().rootWindow)) {
return False;
}

if (None == DeusExRootWindow(player().rootWindow).hud) {
return False;
}

if (!DeusExRootWindow(player().rootWindow).hud.isVisible()){
return False;
}

return True;
}

function IncMissionTimer(int mission)
{
local string flagname, dataname;
Expand Down

0 comments on commit cee2f0f

Please sign in to comment.