mirror of
https://github.com/yquake2/zaero.git
synced 2024-11-10 06:32:04 +00:00
Correctly destroy blocking entities and derefernce entities destroyed by
the killbox
This commit is contained in:
parent
9d1d32d2be
commit
49f92a0c72
1 changed files with 45 additions and 4 deletions
41
src/g_func.c
41
src/g_func.c
|
@ -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)
|
||||
{
|
||||
/* 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)
|
||||
{
|
||||
/* 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)
|
||||
{
|
||||
/* 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)
|
||||
{
|
||||
/* 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)
|
||||
|
|
Loading…
Reference in a new issue