Plane check in blaster2_touch

This commit is contained in:
BjossiAlfreds 2019-10-01 20:44:18 +00:00
parent 1e4c4cc956
commit bedf8cdd9d

View file

@ -1477,8 +1477,9 @@ blaster2_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
{
int mod;
int damagestat;
vec3_t normal;
if (!self || !other || !plane)
if (!self || !other)
{
return;
}
@ -1499,6 +1500,15 @@ blaster2_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
PlayerNoise(self->owner, self->s.origin, PNOISE_IMPACT);
}
if (plane)
{
VectorCopy(plane->normal, normal);
}
else
{
VectorCopy(vec3_origin, normal);
}
if (other->takedamage)
{
mod = MOD_BLASTER2;
@ -1521,8 +1531,9 @@ blaster2_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
self->dmg_radius, 0);
}
T_Damage(other, self, self->owner, self->velocity, self->s.origin, plane->normal,
T_Damage(other, self, self->owner, self->velocity, self->s.origin, normal,
self->dmg, 1, DAMAGE_ENERGY, mod);
self->owner->takedamage = damagestat;
}
else
@ -1534,7 +1545,7 @@ blaster2_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
}
T_Damage(other, self, self->owner, self->velocity, self->s.origin,
plane->normal, self->dmg, 1, DAMAGE_ENERGY, mod);
normal, self->dmg, 1, DAMAGE_ENERGY, mod);
}
}
else
@ -1549,7 +1560,7 @@ blaster2_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
gi.WriteByte(svc_temp_entity);
gi.WriteByte(TE_BLASTER2);
gi.WritePosition(self->s.origin);
gi.WriteDir(plane->normal);
gi.WriteDir(normal);
gi.multicast(self->s.origin, MULTICAST_PVS);
}