diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-04 17:51:20 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-04 17:51:20 +0100 |
| commit | 49df428d95a7c443d418d5b7e2a93af599b54f76 (patch) | |
| tree | 604e64048aacc5e2b86f441e03e5e5ab8600bef2 /src/netvars.cpp | |
| parent | Items: skip the CNetworkArray length header for m_iAmmo/m_hMyWeapons (diff) | |
| download | hl2h-49df428d95a7c443d418d5b7e2a93af599b54f76.tar.gz hl2h-49df428d95a7c443d418d5b7e2a93af599b54f76.zip | |
Add chams
- Hook IVModelRender::DrawModelExecute (VEngineModel016 slot 19) and force
models/debug/debugwhite for NPC models, identified by
ModelRenderInfo_t::entity_index.
- Two passes: MATERIAL_VAR_IGNOREZ through walls, then normal depth, with
IMaterial::ColorModulate for the configured colour; restore the shared
material's flag/colour afterwards.
- Material lookup via the IMaterialSystem list, FindMaterial fallback.
- New Chams feature/card with Through walls and colour; [chams] config.
- Remove the temporary ammo/projectile/fuse diagnostics.
Diffstat (limited to '')
| -rw-r--r-- | src/netvars.cpp | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/src/netvars.cpp b/src/netvars.cpp index 6a34ee5..e22ff38 100644 --- a/src/netvars.cpp +++ b/src/netvars.cpp | |||
| @@ -61,15 +61,8 @@ static void collect_netvars(uintptr_t table, uintptr_t base_off, int depth) { | |||
| 61 | uintptr_t ptable = *(uintptr_t *)(prop + 0x28); | 61 | uintptr_t ptable = *(uintptr_t *)(prop + 0x28); |
| 62 | 62 | ||
| 63 | char pname2[64]; | 63 | char pname2[64]; |
| 64 | if (!module_string(pname, pname2, sizeof(pname2))) { | 64 | if (!module_string(pname, pname2, sizeof(pname2))) |
| 65 | static int bad_names = 0; | ||
| 66 | if (bad_names < 8) { | ||
| 67 | bad_names++; | ||
| 68 | logf("netvar: unreadable prop name %#lx in %s", (unsigned long)pname, | ||
| 69 | tname); | ||
| 70 | } | ||
| 71 | continue; | 65 | continue; |
| 72 | } | ||
| 73 | 66 | ||
| 74 | if (dump) | 67 | if (dump) |
| 75 | logd(" [%s] %s type=%d off=%d(0x%x) table=%s array=%s", tname, pname2, | 68 | logd(" [%s] %s type=%d off=%d(0x%x) table=%s array=%s", tname, pname2, |
| @@ -90,13 +83,6 @@ static void collect_netvars(uintptr_t table, uintptr_t base_off, int depth) { | |||
| 90 | g_net.my_weapons = off; | 83 | g_net.my_weapons = off; |
| 91 | logf("netvar: m_hMyWeapons prop=%s poff=%d elem=%p -> %d", pname2, | 84 | logf("netvar: m_hMyWeapons prop=%s poff=%d elem=%p -> %d", pname2, |
| 92 | poff, (void *)elem, off); | 85 | poff, (void *)elem, off); |
| 93 | } else { | ||
| 94 | static int bad = 0; | ||
| 95 | if (bad < 8) { | ||
| 96 | bad++; | ||
| 97 | logf("netvar: m_hMyWeapons prop=%s rejected poff=%d elem=%p off=%d", | ||
| 98 | pname2, poff, (void *)elem, off); | ||
| 99 | } | ||
| 100 | } | 86 | } |
| 101 | continue; | 87 | continue; |
| 102 | } | 88 | } |
| @@ -112,13 +98,6 @@ static void collect_netvars(uintptr_t table, uintptr_t base_off, int depth) { | |||
| 112 | g_net.ammo = off; | 98 | g_net.ammo = off; |
| 113 | logf("netvar: m_iAmmo prop=%s poff=%d elem=%p -> %d", pname2, poff, | 99 | logf("netvar: m_iAmmo prop=%s poff=%d elem=%p -> %d", pname2, poff, |
| 114 | (void *)elem, off); | 100 | (void *)elem, off); |
| 115 | } else { | ||
| 116 | static int bad = 0; | ||
| 117 | if (bad < 8) { | ||
| 118 | bad++; | ||
| 119 | logf("netvar: m_iAmmo prop=%s rejected poff=%d elem=%p off=%d", | ||
| 120 | pname2, poff, (void *)elem, off); | ||
| 121 | } | ||
| 122 | } | 101 | } |
| 123 | continue; | 102 | continue; |
| 124 | } | 103 | } |
| @@ -126,14 +105,6 @@ static void collect_netvars(uintptr_t table, uintptr_t base_off, int depth) { | |||
| 126 | collect_netvars(ptable, base_off + (uint32_t)poff, depth + 1); | 105 | collect_netvars(ptable, base_off + (uint32_t)poff, depth + 1); |
| 127 | continue; | 106 | continue; |
| 128 | } | 107 | } |
| 129 | if (parray) { | ||
| 130 | static int alogs = 0; | ||
| 131 | if (alogs < 16) { | ||
| 132 | alogs++; | ||
| 133 | logf("netvar array %s poff=%d eoff=%d base=%d", pname2, poff, | ||
| 134 | *(int32_t *)(parray + 0x2C), (int)base_off); | ||
| 135 | } | ||
| 136 | } | ||
| 137 | 108 | ||
| 138 | if (strcmp(pname2, "m_lifeState") == 0 && g_net.lifestate < 0) { | 109 | if (strcmp(pname2, "m_lifeState") == 0 && g_net.lifestate < 0) { |
| 139 | g_net.lifestate = (int)(base_off + (uint32_t)poff); | 110 | g_net.lifestate = (int)(base_off + (uint32_t)poff); |
