Compare commits
No commits in common. "72dc42006fd1997534ef54bb66527957bd1e70ff" and "44e5dc34c0cfe2105627f2604f227bb68ce3375c" have entirely different histories.
72dc42006f
...
44e5dc34c0
|
@ -28,6 +28,7 @@ bool isSpacebarPressed() {
|
|||
return pressed;
|
||||
}
|
||||
|
||||
|
||||
void anti_aim(usercmd_t* cmd) {
|
||||
if (cmd->buttons & IN_ATTACK || cmd->buttons & IN_USE) {
|
||||
if (cmd->buttons & IN_ATTACK) {
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "../include/globals.h"
|
||||
#include "../include/cvars.h"
|
||||
#include "../include/util.h"
|
||||
#include "../include/game_detection.h"
|
||||
|
||||
/* For dz_esp */
|
||||
enum esp_values {
|
||||
|
@ -103,32 +102,38 @@ void esp(void) {
|
|||
if (setting == ESP_OFF)
|
||||
return;
|
||||
|
||||
/* Iterate all clients */
|
||||
for (int i = 1; i <= i_engine->GetMaxClients(); i++) {
|
||||
cl_entity_t* ent = get_player(i);
|
||||
|
||||
if (!valid_player(ent) || !is_alive(ent) || vec_is_zero(ent->origin))
|
||||
continue;
|
||||
|
||||
// Check if the player is friendly and if visuals_friendly is 0
|
||||
if (is_friend(ent) && dz_visuals_friendly->value == 0)
|
||||
continue;
|
||||
|
||||
int bh = 70;
|
||||
if (IsDayOfDefeat()) {
|
||||
bh = 76;
|
||||
} else if (ent->curstate.usehull == 1) {
|
||||
bh = 44;
|
||||
}
|
||||
const int bh = (ent->curstate.usehull == 1) ? 44 : 70;
|
||||
/* const int bw = 25; */
|
||||
|
||||
/* If ESP_BOX is enabled, draw it. If it returns false, continue */
|
||||
if (setting & ESP_BOX && !gl_draw2dbox(ent->origin, bh))
|
||||
continue;
|
||||
|
||||
/* Rest of the loop is for name esp, if var is not enabled, continue */
|
||||
if (!(setting & ESP_NAME))
|
||||
continue;
|
||||
|
||||
vec3_t name_pos = vec3(ent->origin.x, ent->origin.y, ent->origin.z + bh + 5);
|
||||
vec2_t s_name_pos;
|
||||
if (world_to_screen(name_pos, s_name_pos)) {
|
||||
engine_draw_text(s_name_pos[0] - 5, s_name_pos[1] - 2, get_name(ent->index), (rgb_t){ 255, 255, 255 });
|
||||
}
|
||||
/* Draw name on top of the player. */
|
||||
vec3_t top = vec3(ent->origin.x, ent->origin.y, ent->origin.z + bh);
|
||||
vec2_t s_top;
|
||||
|
||||
if (!world_to_screen(top, s_top))
|
||||
continue;
|
||||
|
||||
/* TODO: Instead of -5px, center the player name to the player origin.
|
||||
* I don't know how to get the text size before rendering. */
|
||||
engine_draw_text(s_top[0] - 5, s_top[1] - 2, get_name(ent->index),
|
||||
(rgb_t){ 255, 255, 255 });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,6 +94,7 @@ int h_HUD_Redraw(float time, int intermission) {
|
|||
} else {
|
||||
color = (rgb_t){ 0, 255, 255 }; // default color
|
||||
}
|
||||
|
||||
/* Watermark */
|
||||
engine_draw_text(5, 5, "https://git.deadzone.lol/Wizzard/goldsource-cheat", color);
|
||||
}
|
||||
|
|
|
@ -163,15 +163,10 @@ bool world_to_screen(vec3_t vec, vec2_t screen) {
|
|||
scr_inf.iSize = sizeof(SCREENINFO);
|
||||
i_engine->pfnGetScreenInfo(&scr_inf);
|
||||
|
||||
/* If within bounds, transform to screen scale */
|
||||
if (screen[0] < 1 && screen[1] < 1 && screen[0] > -1 && screen[1] > -1) {
|
||||
if (IsDayOfDefeat()) {
|
||||
printf("Before transformation: %f, %f, Depth: %f\n", screen[0], screen[1], screen[2]);
|
||||
screen[0] = ((screen[0] + 1) * 0.5) * scr_inf.iWidth;
|
||||
screen[1] = ((1 - screen[1]) * 0.5) * scr_inf.iHeight;
|
||||
} else {
|
||||
screen[0] = screen[0] * (scr_inf.iWidth / 2) + (scr_inf.iWidth / 2);
|
||||
screen[1] = -screen[1] * (scr_inf.iHeight / 2) + (scr_inf.iHeight / 2);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue