diff --git a/src/g_phys.c b/src/g_phys.c index 3be3f24..b3df9d5 100644 --- a/src/g_phys.c +++ b/src/g_phys.c @@ -828,6 +828,10 @@ void SV_Physics_Toss (edict_t *ent) // regular thinking SV_RunThink (ent); + /* entities are very often freed during thinking */ + if (!ent->inuse) + return; + // if not a team captain, so movement will be handled elsewhere if ( ent->flags & FL_TEAMSLAVE) return; diff --git a/src/monster/flipper/flipper.c b/src/monster/flipper/flipper.c index 6d3d2c7..6044d5e 100644 --- a/src/monster/flipper/flipper.c +++ b/src/monster/flipper/flipper.c @@ -276,13 +276,24 @@ void flipper_pain (edict_t *self, edict_t *other, float kick, int damage) void flipper_dead (edict_t *self) { + vec3_t p; + trace_t tr; + if (!self) { return; } - VectorSet (self->mins, -16, -16, -24); - VectorSet (self->maxs, 16, 16, -8); + /* original dead bbox was wrong - and make sure the bbox adjustment stays in solidity */ + + p[0] = self->s.origin[0]; + p[1] = self->s.origin[1]; + p[2] = self->s.origin[2] - 8; + + tr = gi.trace(self->s.origin, self->mins, self->maxs, p, self, self->clipmask); + + self->mins[2] = tr.endpos[2] - self->s.origin[2]; + self->movetype = MOVETYPE_TOSS; self->svflags |= SVF_DEADMONSTER; self->nextthink = 0;