From ea292fa6e05b4a6dcbc72c5ec7ac215299cf61e9 Mon Sep 17 00:00:00 2001 From: GenZmeY Date: Sun, 13 Sep 2020 19:19:33 +0300 Subject: [PATCH] fix: skip trader button --- ServerExt/Classes/UI_MidGameMenu.uc | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/ServerExt/Classes/UI_MidGameMenu.uc b/ServerExt/Classes/UI_MidGameMenu.uc index ce40e44..c80f20a 100644 --- a/ServerExt/Classes/UI_MidGameMenu.uc +++ b/ServerExt/Classes/UI_MidGameMenu.uc @@ -7,7 +7,7 @@ var KFGUI_Button AdminButton,SpectateButton,SkipTraderButton; var transient KFGUI_Button PrevButton; var transient int NumButtons,NumButtonRows; -var transient bool bInitSpectate,bOldSpectate,bInitSkipTrader; +var transient bool bInitSpectate,bOldSpectate; var localized string MapVoteButtonText; var localized string MapVoteButtonToolTip; @@ -74,19 +74,12 @@ function bool SkipTraderIsAviable(PlayerReplicationInfo PRI) local KFPlayerReplicationInfo KFPRI; KFPRI = KFPlayerReplicationInfo(PRI); - if (KFPRI == none) + KFGRI = KFGameReplicationInfo(KFPRI.WorldInfo.GRI); + + if ( KFGRI == none || KFPRI == none) return false; - KFGRI = KFGameReplicationInfo(KFPRI.WorldInfo.GRI); - if (KFGRI.bMatchHasBegun && KFGRI.bTraderIsOpen && KFPRI.bHasSpawnedIn) - { - return !bInitSkipTrader; - } - else - { - bInitSkipTrader=false; - return false; - } + return KFGRI.bMatchHasBegun && KFGRI.bTraderIsOpen && KFPRI.bHasSpawnedIn && !KFPRI.bVotedToSkipTraderTime; } function ShowMenu() @@ -131,7 +124,6 @@ function ButtonClicked( KFGUI_Button Sender ) break; case 'SkipTrader': KFPlayerController(GetPlayer()).RequestSkipTrader(); - bInitSkipTrader=true; SkipTraderButton.SetDisabled(true); break; } @@ -186,7 +178,6 @@ defaultproperties Pages.Add(Class'UIP_AdminMenu') Pages.Add(Class'UIP_About') Pages.Add(Class'UIP_MiniGame') - bInitSkipTrader=false Begin Object Class=KFGUI_SwitchMenuBar Name=MultiPager ID="Pager"