mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-01-31 21:30:36 +00:00
Fix a too strict sanity check in void blaster_touch()
This sanity check caused a too early exit of the function if the player stood directly in front of a wall and fires the blaster or hyper blaster. Therefor the wall impact effect wasn't drawn. This commit fixes issue #6. Many thanks to svdijk for narrowing this problem down to somewhere between 3.00 and 4.00.
This commit is contained in:
parent
67fb773a78
commit
8819ad1c9a
1 changed files with 7 additions and 4 deletions
|
@ -379,7 +379,7 @@ blaster_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
|
|||
{
|
||||
int mod;
|
||||
|
||||
if (!self || !other || !plane || !surf)
|
||||
if (!self || !other)
|
||||
{
|
||||
G_FreeEdict(self);
|
||||
return;
|
||||
|
@ -390,7 +390,7 @@ blaster_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
|
|||
return;
|
||||
}
|
||||
|
||||
if (surf->flags & SURF_SKY)
|
||||
if (!surf && (!surf->flags & SURF_SKY))
|
||||
{
|
||||
G_FreeEdict(self);
|
||||
return;
|
||||
|
@ -412,8 +412,11 @@ blaster_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
|
|||
mod = MOD_BLASTER;
|
||||
}
|
||||
|
||||
T_Damage(other, self, self->owner, self->velocity, self->s.origin,
|
||||
plane->normal, self->dmg, 1, DAMAGE_ENERGY, mod);
|
||||
if (plane)
|
||||
{
|
||||
T_Damage(other, self, self->owner, self->velocity, self->s.origin,
|
||||
plane->normal, self->dmg, 1, DAMAGE_ENERGY, mod);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue