diff options
Diffstat (limited to 'src/hl2h.h')
| -rw-r--r-- | src/hl2h.h | 15 |
1 files changed, 13 insertions, 2 deletions
| @@ -36,7 +36,7 @@ struct Module { | |||
| 36 | return false; | 36 | return false; |
| 37 | } | 37 | } |
| 38 | }; | 38 | }; |
| 39 | extern Module g_client, g_engine; | 39 | extern Module g_client, g_engine, g_server; |
| 40 | 40 | ||
| 41 | // --------------------------------------------------------------------------- | 41 | // --------------------------------------------------------------------------- |
| 42 | // game interfaces | 42 | // game interfaces |
| @@ -48,6 +48,9 @@ struct GameInterfaces { | |||
| 48 | void *client = nullptr; | 48 | void *client = nullptr; |
| 49 | void *entitylist = nullptr; | 49 | void *entitylist = nullptr; |
| 50 | void *engine = nullptr; | 50 | void *engine = nullptr; |
| 51 | void *modelinfo = nullptr; // IVModelInfoClient006 (model index -> model name) | ||
| 52 | void *engineserver = nullptr; // IVEngineServer021 (edict access, incl. server entities) | ||
| 53 | void *debugoverlay = nullptr; // IVDebugOverlay003 (engine-accurate world->screen) | ||
| 51 | }; | 54 | }; |
| 52 | extern GameInterfaces g_iface; | 55 | extern GameInterfaces g_iface; |
| 53 | 56 | ||
| @@ -70,9 +73,13 @@ struct NetVars { | |||
| 70 | int viewoffset = -1; | 73 | int viewoffset = -1; |
| 71 | int mins = -1; | 74 | int mins = -1; |
| 72 | int maxs = -1; | 75 | int maxs = -1; |
| 76 | int lifestate = -1; | ||
| 77 | int modelindex = -1; | ||
| 73 | // ponytail: mins/maxs may be absent from some HL2 netvar tables; esp.cpp falls back to h=72 | 78 | // ponytail: mins/maxs may be absent from some HL2 netvar tables; esp.cpp falls back to h=72 |
| 74 | bool ok() const { return flags >= 0 && velocity >= 0 && movetype >= 0; } | 79 | bool ok() const { return flags >= 0 && velocity >= 0 && movetype >= 0; } |
| 75 | bool esp_ok() const { return ok() && health >= 0 && maxhealth >= 0 && teamnum >= 0 && origin >= 0 && viewoffset >= 0; } | 80 | // ponytail: m_iMaxHealth isn't a netvar in HL2 SP; esp.cpp falls back to 100. |
| 81 | // m_iHealth only ever updates for players — NPCs are detected via m_lifeState. | ||
| 82 | bool esp_ok() const { return ok() && health >= 0 && teamnum >= 0 && origin >= 0 && viewoffset >= 0; } | ||
| 76 | }; | 83 | }; |
| 77 | extern NetVars g_net; | 84 | extern NetVars g_net; |
| 78 | 85 | ||
| @@ -139,6 +146,10 @@ void fix_verified_crc(int seq, uint32_t crc); | |||
| 139 | uint32_t usercmd_checksum(const CUserCmd *c); | 146 | uint32_t usercmd_checksum(const CUserCmd *c); |
| 140 | bool find_input_global(); | 147 | bool find_input_global(); |
| 141 | void resolve_netvars(); | 148 | void resolve_netvars(); |
| 149 | int class_health_off(const char *name); | ||
| 150 | bool resolve_server_netvars(); | ||
| 151 | int server_entity_health(int idx, int *maxhealth, int *lifestate, void **base_out); | ||
| 152 | int server_model_index(void *base); | ||
| 142 | void find_modules(); | 153 | void find_modules(); |
| 143 | void init_conmsg(); | 154 | void init_conmsg(); |
| 144 | bool feature_active(int feature); | 155 | bool feature_active(int feature); |
