Fix cbuf not being terminated

This commit is contained in:
FutureRave 2022-02-07 12:28:17 +00:00
parent 18dca4506f
commit 61becec5f8
No known key found for this signature in database
GPG Key ID: E883E2BC9657D955
4 changed files with 8 additions and 5 deletions

View File

@ -1173,8 +1173,7 @@ namespace Components
}
else
{
Game::Cbuf_AddText(gamePadIndex, keyBinding);
Game::Cbuf_AddText(gamePadIndex, "\n");
Game::Cbuf_InsertText(gamePadIndex, keyBinding);
}
}
}

View File

@ -29,7 +29,7 @@ namespace Components
Game::Dvar_SetStringByName("ui_startupMessage", message.data());
Game::Dvar_SetStringByName("ui_startupMessageTitle", Utils::String::VA("Messages (%d/%d)", StartupMessages::TotalMessages - StartupMessages::MessageList.size(), StartupMessages::TotalMessages));
Game::Dvar_SetStringByName("ui_startupNextButtonText", StartupMessages::MessageList.size() ? "Next" : "Close");
Game::Cbuf_AddText(0, "openmenu startup_messages");
Game::Cbuf_AddText(0, "openmenu startup_messages\n");
});
}

View File

@ -34,6 +34,7 @@ namespace Game
Cbuf_AddServerText_t Cbuf_AddServerText = Cbuf_AddServerText_t(0x4BB9B0);
Cbuf_AddText_t Cbuf_AddText = Cbuf_AddText_t(0x404B20);
Cbuf_InsertText_t Cbuf_InsertText = Cbuf_InsertText_t(0x4940B0);
CG_NextWeapon_f_t CG_NextWeapon_f = CG_NextWeapon_f_t(0x449DE0);
CG_GetClientNum_t CG_GetClientNum = CG_GetClientNum_t(0x433700);
@ -657,7 +658,7 @@ namespace Game
{
Dvar_SetStringByName("com_errorMessage", message.data());
Dvar_SetStringByName("com_errorTitle", title.data());
Cbuf_AddText(0, "openmenu error_popmenu_lobby");
Cbuf_AddText(0, "openmenu error_popmenu_lobby\n");
}
}

View File

@ -46,9 +46,12 @@ namespace Game
typedef void(__cdecl * Cbuf_AddServerText_t)();
extern Cbuf_AddServerText_t Cbuf_AddServerText;
typedef void(__cdecl * Cbuf_AddText_t)(int localClientNum, const char *text);
typedef void(__cdecl * Cbuf_AddText_t)(int localClientNum, const char* text);
extern Cbuf_AddText_t Cbuf_AddText;
typedef void(__cdecl * Cbuf_InsertText_t)(int localClientNum, const char* text);
extern Cbuf_InsertText_t Cbuf_InsertText;
typedef int(__cdecl * CG_GetClientNum_t)();
extern CG_GetClientNum_t CG_GetClientNum;