mirror of
https://github.com/nzp-team/quakec.git
synced 2024-11-22 20:01:34 +00:00
SERVER: Add a 0.25s delay before checking if we're facing an enemy
This commit is contained in:
parent
e63f68e897
commit
f85f3e5429
1 changed files with 23 additions and 17 deletions
|
@ -336,6 +336,7 @@ void() PlayerPreThink =
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
float player_trace_time;
|
||||||
void() PlayerPostThink =
|
void() PlayerPostThink =
|
||||||
{
|
{
|
||||||
if(self.isspec)
|
if(self.isspec)
|
||||||
|
@ -440,7 +441,9 @@ void() PlayerPostThink =
|
||||||
|
|
||||||
// Perform a traceline to keep track of entities directly
|
// Perform a traceline to keep track of entities directly
|
||||||
// in front of the player.
|
// in front of the player.
|
||||||
|
// Also don't do it every frame because that's really tough
|
||||||
|
// on perf.
|
||||||
|
if (player_trace_time < time) {
|
||||||
vector source;
|
vector source;
|
||||||
|
|
||||||
makevectors (self.v_angle);
|
makevectors (self.v_angle);
|
||||||
|
@ -473,6 +476,9 @@ void() PlayerPostThink =
|
||||||
else
|
else
|
||||||
self.facingenemy = false;
|
self.facingenemy = false;
|
||||||
|
|
||||||
|
// 1/4 of a second is enough of a delay to not kill the effect.
|
||||||
|
player_trace_time = time + 0.25;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void() ClientKill = {};
|
void() ClientKill = {};
|
||||||
|
|
Loading…
Reference in a new issue