diff options
| author | salmonik <salmonik@tuta.io> | 2026-09-14 16:47:32 +0200 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-09-14 16:47:32 +0200 |
| commit | 8af245ae414cb548a2188030ed8a52b31986252f (patch) | |
| tree | 0c77362c60b3441ddbb9d4da80944e667f24a927 /src/hl2h.cpp | |
| parent | Remove Climb feature; keep bind system for aimbot prep (mouse buttons bindable) (diff) | |
| download | hl2h-8af245ae414cb548a2188030ed8a52b31986252f.tar.gz hl2h-8af245ae414cb548a2188030ed8a52b31986252f.zip | |
Default map d1_town_01 (intro-less, enemies spawned)
Diffstat (limited to '')
| -rw-r--r-- | src/hl2h.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
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, ...) { | |||
| 32 | Module g_client, g_engine; | 32 | Module g_client, g_engine; |
| 33 | GameInterfaces g_iface; | 33 | GameInterfaces g_iface; |
| 34 | NetVars g_net; | 34 | NetVars g_net; |
| 35 | uintptr_t g_input = 0; | 35 | Vector g_cam_eye{0, 0, 0}; |
| 36 | Vector g_cam_view{0, 0, 0}; | ||
| 36 | 37 | ||
| 37 | // --------------------------------------------------------------------------- | 38 | // --------------------------------------------------------------------------- |
| 38 | // vector math | 39 | // vector math |
| @@ -81,7 +82,7 @@ float getfov(const QAngle &my_view, const QAngle &aim_ang) { | |||
| 81 | } | 82 | } |
| 82 | 83 | ||
| 83 | // --------------------------------------------------------------------------- | 84 | // --------------------------------------------------------------------------- |
| 84 | // feature logic (bhop, ABH, climb) | 85 | // feature logic (bhop, ABH) |
| 85 | // --------------------------------------------------------------------------- | 86 | // --------------------------------------------------------------------------- |
| 86 | 87 | ||
| 87 | static int g_modified_logged = 0; | 88 | static int g_modified_logged = 0; |
| @@ -103,19 +104,16 @@ void note_modified(const CUserCmd *cmd, int flags, const float *vel) { | |||
| 103 | 104 | ||
| 104 | static bool g_logged_local = false; | 105 | static bool g_logged_local = false; |
| 105 | 106 | ||
| 106 | static int engine_get_local_player() { | 107 | int engine_get_local_player() { |
| 107 | using Fn = int (*)(void *); | 108 | using Fn = int (*)(void *); |
| 108 | return vfunc<Fn>(g_iface.engine, 12)(g_iface.engine); | 109 | return vfunc<Fn>(g_iface.engine, 12)(g_iface.engine); |
| 109 | } | 110 | } |
| 110 | 111 | ||
| 111 | static void *entitylist_get(int idx) { | 112 | void *entitylist_get(int idx) { |
| 112 | using Fn = void *(*)(void *, int); | 113 | using Fn = void *(*)(void *, int); |
| 113 | return vfunc<Fn>(g_iface.entitylist, 3)(g_iface.entitylist, idx); | 114 | return vfunc<Fn>(g_iface.entitylist, 3)(g_iface.entitylist, idx); |
| 114 | } | 115 | } |
| 115 | 116 | ||
| 116 | |||
| 117 | |||
| 118 | |||
| 119 | static void do_move(int seq) { | 117 | static void do_move(int seq) { |
| 120 | static bool g_echo_sent = false; | 118 | static bool g_echo_sent = false; |
| 121 | if (!g_input || !g_net.ok()) | 119 | if (!g_input || !g_net.ok()) |
| @@ -148,6 +146,9 @@ static void do_move(int seq) { | |||
| 148 | return; | 146 | return; |
| 149 | 147 | ||
| 150 | uintptr_t e = (uintptr_t)ent; | 148 | uintptr_t e = (uintptr_t)ent; |
| 149 | g_cam_eye = {*(float *)(e + g_net.origin), *(float *)(e + g_net.origin + 4), *(float *)(e + g_net.origin + 8)}; | ||
| 150 | g_cam_eye.z += *(float *)(e + g_net.viewoffset); | ||
| 151 | g_cam_view = {cmd->viewangles[0], cmd->viewangles[1], cmd->viewangles[2]}; | ||
| 151 | int flags = *(int *)(e + g_net.flags); | 152 | int flags = *(int *)(e + g_net.flags); |
| 152 | bool onground = (flags & FL_ONGROUND) != 0; | 153 | bool onground = (flags & FL_ONGROUND) != 0; |
| 153 | bool inwater = (flags & FL_INWATER) != 0; | 154 | bool inwater = (flags & FL_INWATER) != 0; |
