self.anim_forwardleft = '20 1 1';
self.anim_backright = '21 1 1';
self.anim_backleft = '22 1 1';
+ self.anim_melee = '23 1 1';
animparseerror = FALSE;
animfilename = strcat(self.model, ".animinfo");
animfile = fopen(animfilename, FILE_READ);
self.anim_forwardleft = animparseline(animfile);
self.anim_backright = animparseline(animfile);
self.anim_backleft = animparseline(animfile);
+ self.anim_melee = animparseline(animfile);
fclose(animfile);
// derived anims
frag_inflictor = inflictor;
frag_target = self;
MUTATOR_CALLHOOK(PlayerDies);
+ weapon_action(self.weapon, WR_PLAYERDEATH);
if(self.flagcarried)
{
}
}
-// sendflags use: 1 = origin, 2 = health/armor, 0x80 = same team (includes health), 4 = entity out of range/culled
+// sendflags use: 1 = origin, 2 = health (0 or 1 for dead/alive on enemies), 4 = armor, 0x80 = same team (includes health)
float SendEntity_ShowNames(entity to, float sendflags)
{
+ float the_health;
+ the_health = self.health;
+
WriteByte(MSG_ENTITY, ENT_CLIENT_SHOWNAMES);
WriteByte(MSG_ENTITY, num_for_edict(self.owner));
sendflags = sendflags & 127;
if(teams_matter && self.owner.team == to.team)
sendflags |= 128;
- else
- sendflags &~= 2;
+ else if(self.owner.health >= 1)
+ the_health = 1;
+
WriteByte(MSG_ENTITY, sendflags);
if(sendflags & 1)
{
}
if(sendflags & 2)
{
- WriteByte(MSG_ENTITY, self.health);
+ WriteByte(MSG_ENTITY, the_health);
+ }
+ if(sendflags & 4)
+ {
WriteByte(MSG_ENTITY, self.armorvalue);
}
return TRUE;
self.armorvalue = max(0, floor(self.owner.armorvalue));
self.SendFlags |= 2;
}
+ if(self.armorvalue != max(0, floor(self.owner.armorvalue)))
+ {
+ self.armorvalue = max(0, floor(self.owner.armorvalue));
+ self.SendFlags |= 4;
+ }
self.nextthink = time;
}