use userraw instead of main
This commit is contained in:
parent
b706e21381
commit
b18445d2e8
@ -91,7 +91,7 @@ private:
|
||||
static void log_message(const std::string& message)
|
||||
{
|
||||
OutputDebugStringA(message.data());
|
||||
log_file::info("%s", message.data());
|
||||
log_file::com_log_print_message(message);
|
||||
game::native::Conbuf_AppendText(message.data());
|
||||
}
|
||||
|
||||
|
@ -268,6 +268,9 @@ void file_system::post_load()
|
||||
|
||||
// Make open-iw5 work outside of the game directory
|
||||
sys_default_install_path_hook.create(SELECT_VALUE(0x487E50, 0x5C4A80, 0x535F80), &sys_default_install_path_stub);
|
||||
|
||||
// fs_basegame
|
||||
utils::hook::set<const char*>(SELECT_VALUE(0x629031, 0x5B0FD1, 0x526F5C), "userraw");
|
||||
}
|
||||
|
||||
REGISTER_MODULE(file_system)
|
||||
|
@ -36,7 +36,7 @@ void log_file::com_open_log_file()
|
||||
}
|
||||
}
|
||||
|
||||
void log_file::com_log_print_message(const char* msg)
|
||||
void log_file::com_log_print_message(const std::string& msg)
|
||||
{
|
||||
char print_buffer[0x40]{};
|
||||
|
||||
@ -61,8 +61,8 @@ void log_file::com_log_print_message(const char* msg)
|
||||
file_system::write(print_buffer, len, *game::native::logfile);
|
||||
}
|
||||
|
||||
log_next_time_stamp = std::strchr(msg, 10) != nullptr;
|
||||
file_system::write(msg, static_cast<int>(std::strlen(msg)), *game::native::logfile);
|
||||
log_next_time_stamp = (msg.find('\n') != std::string::npos);
|
||||
file_system::write(msg.data(), static_cast<int>(msg.size()), *game::native::logfile);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ class log_file final : public module
|
||||
public:
|
||||
void post_load() override;
|
||||
|
||||
static void com_log_print_message(const std::string& msg);
|
||||
static void info(const char* fmt, ...);
|
||||
|
||||
private:
|
||||
@ -16,6 +17,4 @@ private:
|
||||
static const game::native::dvar_t* com_logfile;
|
||||
|
||||
static void com_open_log_file();
|
||||
|
||||
static void com_log_print_message(const char* msg);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user