SERVER: Fix bleedout time being inconsistent and ticking while being revived

This commit is contained in:
cypress 2023-11-29 14:04:31 -05:00
parent 9001cf050e
commit 8e0aa1056f
3 changed files with 16 additions and 4 deletions

View file

@ -155,8 +155,12 @@ void() EndGameSetup =
// if they aren't dead, we keep looping until our OWN death (45 seconds, so 300 loops)
void() rec_downed =
{
self.downedloop++;
if (self.downedloop >= 300) {
if (!self.beingrevived)
self.downedloop += 1;
bprint(PRINT_HIGH, strcat(ftos(self.downedloop), "\n"));
if (self.downedloop >= 30) {
DisableReviveIcon(self.electro_targeted);
startspectate();
return;
@ -170,7 +174,7 @@ void() rec_downed =
}
self.think = rec_downed;
self.nextthink = time + 0.1;
self.nextthink = time + 1;
}
float() push_away_zombies;

View file

@ -410,7 +410,7 @@ void() PlayerPreThink =
}
if(self.isspec != 0 && !self.downed)
{
if(self.button0)
if(self.button0 && self.fire_delay < time)
{
self.aiment = find(self.aiment, classname, "player");
if(self.aiment != world)
@ -427,6 +427,7 @@ void() PlayerPreThink =
sprint(self, PRINT_HIGH, "Freefly spectate\n");
self.movetype = MOVETYPE_FLY;
}
self.fire_delay = time + 0.25;
}
if(self.aiment != world)
{

View file

@ -129,6 +129,13 @@ float(string params) Command_noclip =
return COMMAND_FAILURE;
}
if (self.model == "") {
setmodel(self, "models/player.mdl");
setsize(self, VEC_HULL_MIN, VEC_HULL_MAX);
} else {
setmodel(self, "");
}
client_parse_override = false;
return COMMAND_SUCCESS;
}