mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 15:21:44 +00:00
Fix floater melee / zap damage getting applied if enemy is out of range.
Found by @BjossiAlfreds, closes #454.
This commit is contained in:
parent
a942ca4bba
commit
0286cdcd0b
1 changed files with 7 additions and 3 deletions
|
@ -665,9 +665,13 @@ floater_zap(edict_t *self)
|
|||
gi.WriteByte(1); /* sparks */
|
||||
gi.multicast(origin, MULTICAST_PVS);
|
||||
|
||||
T_Damage(self->enemy, self, self, dir, self->enemy->s.origin,
|
||||
vec3_origin, 5 + randk() % 6, -10, DAMAGE_ENERGY,
|
||||
MOD_UNKNOWN);
|
||||
if (range(self, self->enemy) && infront(self, self->enemy) &&
|
||||
visible(self, self->enemy))
|
||||
{
|
||||
T_Damage(self->enemy, self, self, dir, self->enemy->s.origin,
|
||||
vec3_origin, 5 + randk() % 6, -10, DAMAGE_ENERGY,
|
||||
MOD_UNKNOWN);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue