mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-22 20:51:31 +00:00
Force an empty clip mask for thrown heads.
The ThrowHead() and ThrowClientHead() functions are special. They transform the entity given in `self` (mostly the caller itself) into a ripped off head. They don't reset the entities clip mask, which may cause problems in interactions with other entities. Fix that by reseting the clip mask to `0`. `0` should be save, because that's the default and and least SV_TestEntityPosition() handles `0` clip masks. Suggested by @BjossiAlfreds.
This commit is contained in:
parent
acf92bdd08
commit
9d827b13da
1 changed files with 8 additions and 0 deletions
|
@ -277,6 +277,10 @@ ThrowHead(edict_t *self, char *gibname, int damage, int type)
|
|||
self->targetname = NULL;
|
||||
self->die = gib_die;
|
||||
|
||||
// The entity still has the monsters clipmaks.
|
||||
// Reset it to 0 to be on the save side.
|
||||
self->clipmask = 0;
|
||||
|
||||
if (type == GIB_ORGANIC)
|
||||
{
|
||||
self->movetype = MOVETYPE_TOSS;
|
||||
|
@ -335,6 +339,10 @@ ThrowClientHead(edict_t *self, int damage)
|
|||
self->s.sound = 0;
|
||||
self->flags |= FL_NO_KNOCKBACK;
|
||||
|
||||
// The entity still has the monsters clipmaks.
|
||||
// Reset it to 0 to be on the save side.
|
||||
self->clipmask = 0;
|
||||
|
||||
self->movetype = MOVETYPE_BOUNCE;
|
||||
VelocityForDamage(damage, vd);
|
||||
VectorAdd(self->velocity, vd, self->velocity);
|
||||
|
|
Loading…
Reference in a new issue