mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-17 01:21:12 +00:00
Fix the rare "SZ_GetSpace: overflow" bug, triggered by too much gibs or
debris
This commit is contained in:
parent
9047d873ab
commit
58f1ec91cd
2 changed files with 29 additions and 2 deletions
2
TODO
2
TODO
|
@ -1,10 +1,8 @@
|
|||
game.so:
|
||||
- Lazarus (e.g. kmq2) has some nice additions and bugfixes
|
||||
to g_phys.c, mainly for bounding box of rotating brushes
|
||||
- Lazarus (kmq2) has a fix for the rare "too many gibs" crash
|
||||
- Paril has a bugfix to the 125hz bug
|
||||
- Merge CTF with baseq2 (most other sourceports have done this)
|
||||
- No bodyqueue in single player
|
||||
- Move q_shared.* into src/common?
|
||||
|
||||
client:
|
||||
|
|
|
@ -26,6 +26,9 @@
|
|||
|
||||
#include "g_local.h"
|
||||
|
||||
int gibsthisframe = 0;
|
||||
int lastgibframe = 0;
|
||||
|
||||
void
|
||||
Use_Areaportal(edict_t *ent, edict_t *other /* unused */, edict_t *activator /* unused */)
|
||||
{
|
||||
|
@ -193,6 +196,19 @@ ThrowGib(edict_t *self, char *gibname, int damage, int type)
|
|||
return;
|
||||
}
|
||||
|
||||
if (level.framenum > lastgibframe)
|
||||
{
|
||||
gibsthisframe = 0;
|
||||
lastgibframe = level.framenum;
|
||||
}
|
||||
|
||||
gibsthisframe++;
|
||||
|
||||
if (gibsthisframe > 20)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
gib = G_Spawn();
|
||||
|
||||
VectorScale(self->size, 0.5, size);
|
||||
|
@ -361,7 +377,20 @@ ThrowDebris(edict_t *self, char *modelname, float speed, vec3_t origin)
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
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