Use get_entity instead of GetEntityByIndex

This commit is contained in:
8dcc 2023-07-23 22:23:48 +02:00
parent a257317f58
commit e8e6e48952
1 changed files with 4 additions and 3 deletions

View File

@ -66,9 +66,10 @@ void esp(void) {
/* Iterate all clients */
for (int i = 1; i <= i_engine->GetMaxClients(); i++) {
cl_entity_t* ent = i_engine->GetEntityByIndex(i);
cl_entity_t* ent = get_entity(i);
if (!valid_client(ent) || vec_is_zero(ent->origin))
if (!ent || !valid_client(ent) || !is_alive(ent) ||
vec_is_zero(ent->origin))
continue;
const int bh = 70;
@ -84,7 +85,7 @@ void esp(void) {
continue;
i_engine->pfnDrawSetTextColor(1, 1, 1);
i_engine->pfnDrawConsoleString(s_top[0], s_top[1],
i_engine->pfnDrawConsoleString(s_top[0] - 5, s_top[1] - 2,
get_name(ent->index));
}
}