SERVER: Only allow one player to revive teammate in last stand

This commit is contained in:
Steam Deck User 2023-01-24 22:22:48 -05:00
parent efc577410e
commit c16629e04a
2 changed files with 7 additions and 1 deletions

View file

@ -377,6 +377,7 @@ void(entity ent) CheckRevive =
DisableReviveIcon(self.electro_targeted); DisableReviveIcon(self.electro_targeted);
revive_index--; revive_index--;
self.invoke_revive = 0; self.invoke_revive = 0;
self.firer = world;
} }
} }

View file

@ -2254,14 +2254,18 @@ void() CheckPlayer =
{ {
if(ent.classname == "player" && ent != self && ent.downed && !self.downed) if(ent.classname == "player" && ent != self && ent.downed && !self.downed)
{ {
if (ent.beingrevived == false)
useprint (self, 13, 0, 0); useprint (self, 13, 0, 0);
if (self.button7 && !ent.invoke_revive) { if (self.button7 && !ent.invoke_revive) {
if (ent.beingrevived == true && ent.firer != self)
return;
// Broadcast that they're being revived // Broadcast that they're being revived
BroadcastMessageToClient(ent, time + 0.1, 3, self.netname); BroadcastMessageToClient(ent, time + 0.1, 3, self.netname);
ent.beingrevived = true; ent.beingrevived = true;
ent.firer = self;
if (!self.progress_bar_percent) { if (!self.progress_bar_percent) {
ChangeReviveIconState(ent.electro_targeted, 2); ChangeReviveIconState(ent.electro_targeted, 2);
@ -2295,6 +2299,7 @@ void() CheckPlayer =
ChangeReviveIconState(ent.electro_targeted, 1); ChangeReviveIconState(ent.electro_targeted, 1);
self.movetype = MOVETYPE_WALK; self.movetype = MOVETYPE_WALK;
ent.beingrevived = false; ent.beingrevived = false;
ent.firer = world;
W_TakeOut(); W_TakeOut();
self.progress_bar = 0; self.progress_bar = 0;
self.progress_bar_time = 0; self.progress_bar_time = 0;