Correctly destroy blocking entities and derefernce entities destroyed by

the killbox
This commit is contained in:
Yamagi Burmeister 2011-10-12 07:50:52 +00:00
parent 9d1d32d2be
commit 49f92a0c72

View file

@ -487,7 +487,15 @@ void plat_blocked (edict_t *self, edict_t *other)
T_Damage (other, self, self, vec3_origin, other->s.origin, vec3_origin, 100000, 1, 0, MOD_CRUSH);
// if it's still there, nuke it
if (other)
BecomeExplosion1 (other);
{
/* Hack for entity without it's origin near the model */
vec3_t save;
VectorCopy(other->s.origin,save);
VectorMA (other->absmin, 0.5, other->size, other->s.origin);
BecomeExplosion1(other);
}
return;
}
@ -1262,7 +1270,15 @@ void door_blocked (edict_t *self, edict_t *other)
T_Damage (other, self, self, vec3_origin, other->s.origin, vec3_origin, 100000, 1, 0, MOD_CRUSH);
// if it's still there, nuke it
if (other)
BecomeExplosion1 (other);
{
/* Hack for entitiy without their origin near the model */
vec3_t save;
VectorCopy(other->s.origin,save);
VectorMA (other->absmin, 0.5, other->size, other->s.origin);
BecomeExplosion1(other);
}
return;
}
@ -1655,7 +1671,15 @@ void train_blocked (edict_t *self, edict_t *other)
T_Damage (other, self, self, vec3_origin, other->s.origin, vec3_origin, 100000, 1, 0, MOD_CRUSH);
// if it's still there, nuke it
if (other)
BecomeExplosion1 (other);
{
/* Hack for entity without an origin near the model */
vec3_t save;
VectorCopy(other->s.origin,save);
VectorMA (other->absmin, 0.5, other->size, other->s.origin);
BecomeExplosion1(other);
}
return;
}
@ -2219,7 +2243,15 @@ void door_secret_blocked (edict_t *self, edict_t *other)
T_Damage (other, self, self, vec3_origin, other->s.origin, vec3_origin, 100000, 1, 0, MOD_CRUSH);
// if it's still there, nuke it
if (other)
BecomeExplosion1 (other);
{
/* Hack for entities without their origin near the model */
vec3_t save;
VectorCopy(other->s.origin,save);
VectorMA (other->absmin, 0.5, other->size, other->s.origin);
BecomeExplosion1(other);
}
return;
}
@ -2310,6 +2342,15 @@ Kills everything inside when fired, irrespective of protection.
void use_killbox (edict_t *self, edict_t *other, edict_t *activator)
{
KillBox (self);
/* Hack to make sure that really everything is killed */
self->count--;
if (!self->count)
{
self->think = G_FreeEdict;
self->nextthink = level.time + 1;
}
}
void SP_func_killbox (edict_t *ent)