aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/r2engine.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-12 15:25:08 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-12 15:25:08 +0100
commita526ad915694ce9881b7ff093cdab9587d088217 (patch)
tree4deacbfeedd0a8d937ab4747c2e2629e994ce7ec /NorthstarDedicatedTest/r2engine.cpp
parent6768e46b200c63d758bd6e92bd500f3c754c3245 (diff)
downloadNorthstarLauncher-a526ad915694ce9881b7ff093cdab9587d088217.tar.gz
NorthstarLauncher-a526ad915694ce9881b7ff093cdab9587d088217.zip
separate gameutils into multiple r2 headers
Diffstat (limited to 'NorthstarDedicatedTest/r2engine.cpp')
-rw-r--r--NorthstarDedicatedTest/r2engine.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/NorthstarDedicatedTest/r2engine.cpp b/NorthstarDedicatedTest/r2engine.cpp
new file mode 100644
index 00000000..c866186a
--- /dev/null
+++ b/NorthstarDedicatedTest/r2engine.cpp
@@ -0,0 +1,23 @@
+#include "pch.h"
+#include "r2engine.h"
+
+using namespace R2;
+
+// use the R2 namespace for game funcs
+namespace R2
+{
+ Cbuf_GetCurrentPlayerType Cbuf_GetCurrentPlayer;
+ Cbuf_AddTextType Cbuf_AddText;
+ Cbuf_ExecuteType Cbuf_Execute;
+
+ CEngine* g_pEngine;
+} // namespace R2
+
+ON_DLL_LOAD("engine.dll", R2Engine, [](HMODULE baseAddress)
+{
+ Cbuf_GetCurrentPlayer = (Cbuf_GetCurrentPlayerType)((char*)baseAddress + 0x120630);
+ Cbuf_AddText = (Cbuf_AddTextType)((char*)baseAddress + 0x1203B0);
+ Cbuf_Execute = (Cbuf_ExecuteType)((char*)baseAddress + 0x1204B0);
+
+ g_pEngine = *(CEngine**)((char*)baseAddress + 0x7D70C8);
+}) \ No newline at end of file