Skip to content

Commit efe3718

Browse files
committed
Fix load stage emptying
1 parent 98b708c commit efe3718

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

src/xrGame/GamePersistent.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ void CGamePersistent::OnFrame()
528528
{
529529
if (Device.dwPrecacheFrame == 5 && m_intro_event.empty())
530530
{
531-
SetLoadStageTitle("");
531+
SetLoadStageTitle();
532532
m_intro_event.bind(this, &CGamePersistent::game_loaded);
533533
}
534534

@@ -840,10 +840,14 @@ void CGamePersistent::LoadTitle(bool change_tip, shared_str map_name)
840840

841841
void CGamePersistent::SetLoadStageTitle(pcstr ls_title)
842842
{
843-
string512 buff;
844-
constexpr pcstr dots = "..."; // if title is empty don't insert dots
845-
sprintf_s(buff, "%s%s", CStringTable().translate(ls_title).c_str(), ls_title ? dots : "");
846-
pApp->SetLoadStageTitle(buff);
843+
string256 buff;
844+
if (ls_title)
845+
{
846+
xr_sprintf(buff, "%s%s", CStringTable().translate(ls_title).c_str(), "...");
847+
pApp->SetLoadStageTitle(buff);
848+
}
849+
else
850+
pApp->SetLoadStageTitle("");
847851
}
848852

849853
bool CGamePersistent::CanBePaused() { return IsGameTypeSingle() || (g_pGameLevel && Level().IsDemoPlay()); }

src/xrGame/GamePersistent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class CGamePersistent : public IGame_Persistent, public IEventReceiver
8181
virtual void OnRenderPPUI_main();
8282
virtual void OnRenderPPUI_PP();
8383
virtual void LoadTitle(bool change_tip = false, shared_str map_name = "");
84-
void SetLoadStageTitle(pcstr /*ls_title*/) override;
84+
void SetLoadStageTitle(pcstr ls_title = nullptr) override;
8585

8686
virtual bool CanBePaused();
8787

src/xrGame/Level_network_start_client.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ bool CLevel::net_start_client1()
3737
CStringTable().translate("st_client_connecting_to").c_str(),
3838
name_of_server);
3939

40-
g_pGamePersistent->SetLoadStageTitle(temp);
41-
g_pGamePersistent->LoadTitle();
40+
pApp->SetLoadStageTitle(temp);
41+
pApp->LoadStage();
4242
return true;
4343
}
4444

0 commit comments

Comments
 (0)