t7x/src/client/component/dedicated.cpp

33 lines
730 B
C++
Raw Normal View History

2022-11-24 11:25:37 -05:00
#include <std_include.hpp>
#include "loader/component_loader.hpp"
2023-01-02 07:57:00 -05:00
#include "game/game.hpp"
2022-11-24 11:25:37 -05:00
#include <utils/hook.hpp>
namespace dedicated
{
namespace
{
2023-01-09 10:53:51 -05:00
void sv_con_tell_f_stub(game::client_s* cl_0, game::svscmd_type type, [[maybe_unused]] const char* fmt, [[maybe_unused]] int c, char* text)
{
game::SV_SendServerCommand(cl_0, type, "%c \"GAME_SERVER\x15: %s\"", 79, text);
}
2022-11-24 11:25:37 -05:00
}
2023-01-01 15:51:04 -05:00
struct component final : server_component
2022-11-24 11:25:37 -05:00
{
void post_unpack() override
{
2023-01-02 07:57:00 -05:00
// Ignore "bad stats"
utils::hook::set<uint8_t>(0x14052D523_g, 0xEB);
utils::hook::nop(0x14052D4E4_g, 2);
2023-01-09 10:53:51 -05:00
// Fix tell command for IW4M
utils::hook::call(0x14052A8CF_g, sv_con_tell_f_stub);
2022-11-24 11:25:37 -05:00
}
};
}
REGISTER_COMPONENT(dedicated::component)