mirror of
https://github.com/yquake2/xatrix.git
synced 2025-04-25 03:11:08 +00:00
Fix floater melee / zap damage getting applied if enemy is out of range.
Found by @BjossiAlfreds, closes yquake2/yquake2#454.
This commit is contained in:
parent
202513abb8
commit
edb8bf2534
1 changed files with 7 additions and 3 deletions
|
@ -640,9 +640,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 + rand() % 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 + rand() % 6, -10, DAMAGE_ENERGY,
|
||||
MOD_UNKNOWN);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue