mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-26 14:30:48 +00:00
Split the gibs per frame limit between gibs and debris.
The gibs and debris per frame must be limited to prevent server mem map overflows. Until now debris and gibs were handled the same, the debris spawned by rockets and grenates could prevent the actual gibs of the killed monster from spawning. Before this change 20 entities were spawned at max. Now up tp 40 enties can be spawned. This needs some testings. Fixes issue 323.
This commit is contained in:
parent
9525dc35a8
commit
ef55042cef
3 changed files with 13 additions and 18 deletions
|
@ -405,7 +405,6 @@ ExitLevel(void)
|
|||
}
|
||||
|
||||
gibsthisframe = 0;
|
||||
lastgibframe = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -420,6 +419,9 @@ G_RunFrame(void)
|
|||
level.framenum++;
|
||||
level.time = level.framenum * FRAMETIME;
|
||||
|
||||
gibsthisframe = 0;
|
||||
debristhisframe = 0;
|
||||
|
||||
/* choose a client for monsters to target this frame */
|
||||
AI_SetSightClient();
|
||||
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
|
||||
#include "header/local.h"
|
||||
|
||||
int debristhisframe;
|
||||
int gibsthisframe;
|
||||
int lastgibframe;
|
||||
|
||||
void
|
||||
Use_Areaportal(edict_t *ent, edict_t *other /* unused */, edict_t *activator /* unused */)
|
||||
|
@ -196,15 +196,9 @@ ThrowGib(edict_t *self, char *gibname, int damage, int type)
|
|||
return;
|
||||
}
|
||||
|
||||
if (level.framenum > lastgibframe)
|
||||
{
|
||||
gibsthisframe = 0;
|
||||
lastgibframe = level.framenum;
|
||||
}
|
||||
|
||||
gibsthisframe++;
|
||||
|
||||
if (gibsthisframe > 20)
|
||||
if (gibsthisframe > MAX_GIBS)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -223,6 +217,7 @@ ThrowGib(edict_t *self, char *gibname, int damage, int type)
|
|||
gib->flags |= FL_NO_KNOCKBACK;
|
||||
gib->takedamage = DAMAGE_YES;
|
||||
gib->die = gib_die;
|
||||
gib->health = 500;
|
||||
|
||||
if (type == GIB_ORGANIC)
|
||||
{
|
||||
|
@ -378,15 +373,9 @@ ThrowDebris(edict_t *self, char *modelname, float speed, vec3_t origin)
|
|||
return;
|
||||
}
|
||||
|
||||
if (level.framenum > lastgibframe)
|
||||
{
|
||||
gibsthisframe = 0;
|
||||
lastgibframe = level.framenum;
|
||||
}
|
||||
debristhisframe++;
|
||||
|
||||
gibsthisframe++;
|
||||
|
||||
if (gibsthisframe > 20)
|
||||
if (debristhisframe > MAX_DEBRIS)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -108,6 +108,10 @@ typedef enum
|
|||
AMMO_SLUGS
|
||||
} ammo_t;
|
||||
|
||||
/* Maximum debris / gibs per frame */
|
||||
#define MAX_GIBS 20
|
||||
#define MAX_DEBRIS 20
|
||||
|
||||
/* deadflag */
|
||||
#define DEAD_NO 0
|
||||
#define DEAD_DYING 1
|
||||
|
@ -441,8 +445,8 @@ extern spawn_temp_t st;
|
|||
extern int sm_meat_index;
|
||||
extern int snd_fry;
|
||||
|
||||
extern int debristhisframe;
|
||||
extern int gibsthisframe;
|
||||
extern int lastgibframe;
|
||||
|
||||
/* means of death */
|
||||
#define MOD_UNKNOWN 0
|
||||
|
|
Loading…
Reference in a new issue