From 5b8d37094a38aff1b2669056a4011a42450fd9c5 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Sat, 2 Jul 2022 21:51:50 +0100 Subject: Add alias management plus input filtering skeleton Some of the alias stuff was kind of stolen from earlier figuring-out Bill did. More Bill code is also on the way. :^) --- src/demorec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/demorec.c') diff --git a/src/demorec.c b/src/demorec.c index 156e7c6..a0c85a1 100644 --- a/src/demorec.c +++ b/src/demorec.c @@ -165,7 +165,7 @@ static void hook_stop_cb(const struct con_cmdargs *args) { // This finds the "demorecorder" global variable (the engine-wide CDemoRecorder // instance). -static inline bool find_demorecorder(struct con_cmd *cmd_stop) { +static inline bool find_demorecorder(void) { #ifdef _WIN32 // The "stop" command calls the virtual function demorecorder.IsRecording(), // so just look for the load of the "this" pointer into ECX @@ -224,7 +224,7 @@ bool demorec_init(void) { return false; } orig_stop_cb = con_getcmdcb(cmd_stop); - if (!find_demorecorder(cmd_stop)) { + if (!find_demorecorder()) { errmsg_errorx("couldn't find demo recorder instance"); return false; } @@ -245,8 +245,8 @@ bool demorec_init(void) { orig_StopRecording = (StopRecording_func)hook_vtable(vtable, vtidx_StopRecording, (void *)&hook_StopRecording); - orig_record_cb = cmd_record->cb; cmd_record->cb = &hook_record_cb; - orig_stop_cb = cmd_stop->cb; cmd_stop->cb = &hook_stop_cb; + cmd_record->cb = &hook_record_cb; + cmd_stop->cb = &hook_stop_cb; sst_autorecord->base.flags &= ~CON_HIDDEN; return true; -- cgit v1.2.3