fix: remove _s poison

This commit is contained in:
2025-02-06 12:55:05 +01:00
parent 547948a324
commit 5a4f180986
13 changed files with 77 additions and 98 deletions

View File

@ -118,7 +118,7 @@ namespace patches
char* db_read_raw_file_stub(const char* filename, char* buf, const int size)
{
std::string file_name = filename;
if (file_name.find(".cfg") == std::string::npos)
if (!file_name.ends_with(".cfg"))
{
file_name.append(".cfg");
}
@ -127,6 +127,7 @@ namespace patches
if (file.exists())
{
snprintf(buf, size, "%s\n", file.get_buffer().data());
buf[size - 1] = '\0';
return buf;
}
@ -327,6 +328,9 @@ namespace patches
game::Dvar_RegisterInt("scr_game_spectatetype", 1, 0, 99, game::DVAR_FLAG_REPLICATED);
// Disable Com_Error in NET_SendPacket
utils::hook::nop(0x1404D8543, 5);
// Prevent clients from ending the game as non host by sending 'end_game' lui notification
cmd_lui_notify_server_hook.create(0x1402E9390, cmd_lui_notify_server_stub);