summaryrefslogtreecommitdiffstats
path: root/src/esp.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/esp.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/esp.cpp b/src/esp.cpp
index a0d84dd..3db25e6 100644
--- a/src/esp.cpp
+++ b/src/esp.cpp
@@ -675,7 +675,7 @@ static bool active_weapon_contains(void *local_ent, const char *needle) {
675 uint32_t h = *(uint32_t *)((uintptr_t)local_ent + g_net.activeweapon); 675 uint32_t h = *(uint32_t *)((uintptr_t)local_ent + g_net.activeweapon);
676 if (h == 0xFFFFFFFFu) 676 if (h == 0xFFFFFFFFu)
677 return false; 677 return false;
678 int idx = (int)(h & 0xFFFF); 678 int idx = (int)(h & 0x7FF); // networked EHANDLE: 11-bit entity index
679 if (idx <= 0 || idx > 4096) 679 if (idx <= 0 || idx > 4096)
680 return false; 680 return false;
681 void *wep = entitylist_get(idx); 681 void *wep = entitylist_get(idx);
@@ -902,7 +902,7 @@ bool melee_weapon_active(void *local_ent) {
902 if (g_net.activeweapon >= 0) { 902 if (g_net.activeweapon >= 0) {
903 uint32_t h = *(uint32_t *)((uintptr_t)local_ent + g_net.activeweapon); 903 uint32_t h = *(uint32_t *)((uintptr_t)local_ent + g_net.activeweapon);
904 if (h != 0xFFFFFFFFu) 904 if (h != 0xFFFFFFFFu)
905 idx = (int)(h & 0xFFFF); 905 idx = (int)(h & 0x7FF); // 11-bit entity index; upper bits are serial
906 } 906 }
907 const char *cls = nullptr, *model = nullptr; 907 const char *cls = nullptr, *model = nullptr;
908 bool crowbar = check(idx, &cls, &model); 908 bool crowbar = check(idx, &cls, &model);
@@ -1221,7 +1221,7 @@ static bool active_weapon_is_shotgun(void *local_ent) {
1221 uint32_t h = *(uint32_t *)((uintptr_t)local_ent + g_net.activeweapon); 1221 uint32_t h = *(uint32_t *)((uintptr_t)local_ent + g_net.activeweapon);
1222 if (h == 0xFFFFFFFFu) 1222 if (h == 0xFFFFFFFFu)
1223 return false; 1223 return false;
1224 int idx = (int)(h & 0xFFFF); 1224 int idx = (int)(h & 0x7FF); // networked EHANDLE: 11-bit entity index
1225 if (idx <= 0 || idx > 4096) 1225 if (idx <= 0 || idx > 4096)
1226 return false; 1226 return false;
1227 void *wep = entitylist_get(idx); 1227 void *wep = entitylist_get(idx);
@@ -1486,7 +1486,7 @@ static int local_active_weapon_idx(int local_idx) {
1486 uint32_t h = *(uint32_t *)((uintptr_t)local + g_net.activeweapon); 1486 uint32_t h = *(uint32_t *)((uintptr_t)local + g_net.activeweapon);
1487 if (!item_handle_valid(h)) 1487 if (!item_handle_valid(h))
1488 return -1; 1488 return -1;
1489 return (int)(h & 0xFFFF); 1489 return (int)(h & 0x7FF);
1490} 1490}
1491 1491
1492static int classify_weapon(const char *model, const char *cls, char *label, 1492static int classify_weapon(const char *model, const char *cls, char *label,