Small bugfixes

This commit is contained in:
Yamagi Burmeister 2011-09-28 06:35:37 +00:00
parent 5e924e2f96
commit e8b7868eef

View file

@ -172,13 +172,8 @@ Killed(edict_t *targ, edict_t *inflictor, edict_t *attacker,
} }
void void
SpawnDamage(int type, vec3_t origin, vec3_t normal, int damage) SpawnDamage(int type, vec3_t origin, vec3_t normal)
{ {
if (damage > 255)
{
damage = 255;
}
gi.WriteByte(svc_temp_entity); gi.WriteByte(svc_temp_entity);
gi.WriteByte(type); gi.WriteByte(type);
gi.WritePosition(origin); gi.WritePosition(origin);
@ -310,7 +305,7 @@ CheckPowerArmor(edict_t *ent, vec3_t point, vec3_t normal, int damage,
save = damage; save = damage;
} }
SpawnDamage(pa_te_type, point, normal, save); SpawnDamage(pa_te_type, point, normal);
ent->powerarmor_time = level.time + 0.2; ent->powerarmor_time = level.time + 0.2;
power_used = save / damagePerCell; power_used = save / damagePerCell;
@ -387,7 +382,7 @@ CheckArmor(edict_t *ent, vec3_t point, vec3_t normal, int damage,
} }
client->pers.inventory[index] -= save; client->pers.inventory[index] -= save;
SpawnDamage(te_sparks, point, normal, save); SpawnDamage(te_sparks, point, normal);
return save; return save;
} }
@ -400,6 +395,11 @@ M_ReactToDamage(edict_t *targ, edict_t *attacker)
return; return;
} }
if (targ->health <= 0)
{
return;
}
if (!(attacker->client) && !(attacker->svflags & SVF_MONSTER)) if (!(attacker->client) && !(attacker->svflags & SVF_MONSTER))
{ {
return; return;
@ -628,7 +628,7 @@ T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker,
{ {
take = 0; take = 0;
save = damage; save = damage;
SpawnDamage(te_sparks, point, normal, save); SpawnDamage(te_sparks, point, normal);
} }
/* check for invincibility */ /* check for invincibility */
@ -666,11 +666,11 @@ T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker,
{ {
if ((targ->svflags & SVF_MONSTER) || (client)) if ((targ->svflags & SVF_MONSTER) || (client))
{ {
SpawnDamage(TE_BLOOD, point, normal, take); SpawnDamage(TE_BLOOD, point, normal);
} }
else else
{ {
SpawnDamage(te_sparks, point, normal, take); SpawnDamage(te_sparks, point, normal);
} }
targ->health = targ->health - take; targ->health = targ->health - take;