From 9743b58ae4a0eb620ff2f8177f9690ed2293dc0f Mon Sep 17 00:00:00 2001 From: 8dcc <8dcc.git@gmail.com> Date: Thu, 27 Jul 2023 21:27:01 +0200 Subject: [PATCH] Add is_friend template to util.c --- src/include/util.h | 1 + src/util.c | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/include/util.h b/src/include/util.h index 5b552e9..ec1c80e 100644 --- a/src/include/util.h +++ b/src/include/util.h @@ -26,6 +26,7 @@ typedef struct { cl_entity_t* get_player(int ent_idx); bool is_alive(cl_entity_t* ent); bool valid_player(cl_entity_t* ent); +bool is_friend(cl_entity_t* ent); char* get_name(int ent_idx); vec3_t vec3(float x, float y, float z); bool vec_is_zero(vec3_t v); diff --git a/src/util.c b/src/util.c index b4689c1..682a031 100644 --- a/src/util.c +++ b/src/util.c @@ -1,14 +1,14 @@ - -#include "include/util.h" -#include "include/sdk.h" -#include "include/globals.h" - +#include #include #include #include /* getpagesize */ #include /* mprotect */ +#include "include/util.h" +#include "include/sdk.h" +#include "include/globals.h" + cl_entity_t* get_player(int ent_idx) { if (ent_idx < 0 || ent_idx > 32) return NULL; @@ -22,6 +22,7 @@ cl_entity_t* get_player(int ent_idx) { } bool is_alive(cl_entity_t* ent) { + /* TODO */ return ent && ent->curstate.movetype != 6 && ent->curstate.movetype != 0; } @@ -30,6 +31,13 @@ bool valid_player(cl_entity_t* ent) { ent->curstate.messagenum >= localplayer->curstate.messagenum; } +bool is_friend(cl_entity_t* ent) { + /* TODO */ + + (void)ent; + return false; +} + char* get_name(int ent_idx) { hud_player_info_t info; i_engine->pfnGetPlayerInfo(ent_idx, &info);