Get stimpacks working in team-deathmatch.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1873 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
d35e3d8147
commit
d0f050da32
1 changed files with 7 additions and 2 deletions
|
@ -2629,6 +2629,7 @@ float(float iid) UseHealingChem =
|
||||||
local vector source;
|
local vector source;
|
||||||
local float heal;
|
local float heal;
|
||||||
local string x;
|
local string x;
|
||||||
|
local float friendly;
|
||||||
|
|
||||||
|
|
||||||
if (self.attack_finished > time)
|
if (self.attack_finished > time)
|
||||||
|
@ -2658,11 +2659,15 @@ float(float iid) UseHealingChem =
|
||||||
traceline (source, source + v_forward*64, 32, self);
|
traceline (source, source + v_forward*64, 32, self);
|
||||||
if (trace_ent.classname == "player" && trace_ent.team == self.team)
|
if (trace_ent.classname == "player" && trace_ent.team == self.team)
|
||||||
{
|
{
|
||||||
if (trace_ent.health <= 0 && coop == 1)
|
if (coop)
|
||||||
|
friendly = true; //all players are friendly in coop
|
||||||
|
if (teamplay)
|
||||||
|
friendly = trace_ent.team == self.team;
|
||||||
|
if (trace_ent.health <= 0 && friendly)
|
||||||
{
|
{
|
||||||
return RevivePlayer(self, trace_ent);
|
return RevivePlayer(self, trace_ent);
|
||||||
}
|
}
|
||||||
if (trace_ent.health <= 0 && coop == 0)
|
if (!friendly)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (trace_ent.regen >= 1)
|
if (trace_ent.regen >= 1)
|
||||||
|
|
Loading…
Reference in a new issue