mirror of
https://github.com/yquake2/xatrix.git
synced 2025-02-23 20:31:40 +00:00
Merge pull request #64 from BjossiAlfreds/shark-bbox
Shark bbox fix and added inuse check after entity thinking
This commit is contained in:
commit
32304256d5
2 changed files with 19 additions and 2 deletions
|
@ -907,6 +907,12 @@ SV_Physics_Toss(edict_t *ent)
|
||||||
/* regular thinking */
|
/* regular thinking */
|
||||||
SV_RunThink(ent);
|
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 not a team captain, so movement will be handled elsewhere */
|
||||||
if (ent->flags & FL_TEAMSLAVE)
|
if (ent->flags & FL_TEAMSLAVE)
|
||||||
{
|
{
|
||||||
|
|
|
@ -329,13 +329,24 @@ flipper_pain(edict_t *self, edict_t *other /* unused */,
|
||||||
void
|
void
|
||||||
flipper_dead(edict_t *self)
|
flipper_dead(edict_t *self)
|
||||||
{
|
{
|
||||||
|
vec3_t p;
|
||||||
|
trace_t tr;
|
||||||
|
|
||||||
if (!self)
|
if (!self)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorSet(self->mins, -16, -16, -24);
|
/* original dead bbox was wrong - and make sure the bbox adjustment stays in solidity */
|
||||||
VectorSet(self->maxs, 16, 16, -8);
|
|
||||||
|
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->movetype = MOVETYPE_TOSS;
|
||||||
self->svflags |= SVF_DEADMONSTER;
|
self->svflags |= SVF_DEADMONSTER;
|
||||||
self->nextthink = 0;
|
self->nextthink = 0;
|
||||||
|
|
Loading…
Reference in a new issue