summaryrefslogtreecommitdiffstats
path: root/src/hl2h.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/hl2h.h')
-rw-r--r--src/hl2h.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/hl2h.h b/src/hl2h.h
index d6a005e..b693617 100644
--- a/src/hl2h.h
+++ b/src/hl2h.h
@@ -36,7 +36,7 @@ struct Module {
36 return false; 36 return false;
37 } 37 }
38}; 38};
39extern Module g_client, g_engine; 39extern 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};
52extern GameInterfaces g_iface; 55extern 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};
77extern NetVars g_net; 84extern NetVars g_net;
78 85
@@ -139,6 +146,10 @@ void fix_verified_crc(int seq, uint32_t crc);
139uint32_t usercmd_checksum(const CUserCmd *c); 146uint32_t usercmd_checksum(const CUserCmd *c);
140bool find_input_global(); 147bool find_input_global();
141void resolve_netvars(); 148void resolve_netvars();
149int class_health_off(const char *name);
150bool resolve_server_netvars();
151int server_entity_health(int idx, int *maxhealth, int *lifestate, void **base_out);
152int server_model_index(void *base);
142void find_modules(); 153void find_modules();
143void init_conmsg(); 154void init_conmsg();
144bool feature_active(int feature); 155bool feature_active(int feature);