From 8af245ae414cb548a2188030ed8a52b31986252f Mon Sep 17 00:00:00 2001 From: salmonik Date: Mon, 14 Sep 2026 16:47:32 +0200 Subject: Default map d1_town_01 (intro-less, enemies spawned) --- src/hl2h.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/hl2h.cpp') diff --git a/src/hl2h.cpp b/src/hl2h.cpp index c6c0aeb..01fdb0f 100644 --- a/src/hl2h.cpp +++ b/src/hl2h.cpp @@ -32,7 +32,8 @@ void logf(const char *fmt, ...) { Module g_client, g_engine; GameInterfaces g_iface; NetVars g_net; -uintptr_t g_input = 0; +Vector g_cam_eye{0, 0, 0}; +Vector g_cam_view{0, 0, 0}; // --------------------------------------------------------------------------- // vector math @@ -81,7 +82,7 @@ float getfov(const QAngle &my_view, const QAngle &aim_ang) { } // --------------------------------------------------------------------------- -// feature logic (bhop, ABH, climb) +// feature logic (bhop, ABH) // --------------------------------------------------------------------------- static int g_modified_logged = 0; @@ -103,19 +104,16 @@ void note_modified(const CUserCmd *cmd, int flags, const float *vel) { static bool g_logged_local = false; -static int engine_get_local_player() { +int engine_get_local_player() { using Fn = int (*)(void *); return vfunc(g_iface.engine, 12)(g_iface.engine); } -static void *entitylist_get(int idx) { +void *entitylist_get(int idx) { using Fn = void *(*)(void *, int); return vfunc(g_iface.entitylist, 3)(g_iface.entitylist, idx); } - - - static void do_move(int seq) { static bool g_echo_sent = false; if (!g_input || !g_net.ok()) @@ -148,6 +146,9 @@ static void do_move(int seq) { return; uintptr_t e = (uintptr_t)ent; + g_cam_eye = {*(float *)(e + g_net.origin), *(float *)(e + g_net.origin + 4), *(float *)(e + g_net.origin + 8)}; + g_cam_eye.z += *(float *)(e + g_net.viewoffset); + g_cam_view = {cmd->viewangles[0], cmd->viewangles[1], cmd->viewangles[2]}; int flags = *(int *)(e + g_net.flags); bool onground = (flags & FL_ONGROUND) != 0; bool inwater = (flags & FL_INWATER) != 0; -- cgit v1.2.3