mirror of
https://github.com/yquake2/ctf.git
synced 2025-04-21 10:00:46 +00:00
Fix the crash resulting in too much debris or gib.
This commit is contained in:
parent
6ebc0cf18a
commit
30e1a7c140
1 changed files with 28 additions and 0 deletions
28
src/g_misc.c
28
src/g_misc.c
|
@ -21,6 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "header/local.h"
|
||||
|
||||
int gibsthisframe = 0;
|
||||
int lastgibframe = 0;
|
||||
|
||||
/*QUAKED func_group (0 0 0) ?
|
||||
Used to group brushes together just for editor convenience.
|
||||
|
@ -140,6 +142,19 @@ void ThrowGib (edict_t *self, char *gibname, int damage, int type)
|
|||
vec3_t size;
|
||||
float vscale;
|
||||
|
||||
if (level.framenum > lastgibframe)
|
||||
{
|
||||
gibsthisframe = 0;
|
||||
lastgibframe = level.framenum;
|
||||
}
|
||||
|
||||
gibsthisframe++;
|
||||
|
||||
if (gibsthisframe > 20)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
gib = G_Spawn();
|
||||
|
||||
VectorScale (self->size, 0.5, size);
|
||||
|
@ -283,6 +298,19 @@ void ThrowDebris (edict_t *self, char *modelname, float speed, vec3_t origin)
|
|||
edict_t *chunk;
|
||||
vec3_t v;
|
||||
|
||||
if (level.framenum > lastgibframe)
|
||||
{
|
||||
gibsthisframe = 0;
|
||||
lastgibframe = level.framenum;
|
||||
}
|
||||
|
||||
gibsthisframe++;
|
||||
|
||||
if (gibsthisframe > 20)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
chunk = G_Spawn();
|
||||
VectorCopy (origin, chunk->s.origin);
|
||||
gi.setmodel (chunk, modelname);
|
||||
|
|
Loading…
Reference in a new issue