mirror of
https://github.com/yquake2/rogue.git
synced 2024-11-29 07:22:30 +00:00
Merge pull request #24 from BjossiAlfreds/usetargets-crash-fix
Killtarget teamchain cleanup crash fix
This commit is contained in:
commit
120e4684d1
1 changed files with 8 additions and 12 deletions
|
@ -269,7 +269,6 @@ G_UseTargets(edict_t *ent, edict_t *activator)
|
||||||
{
|
{
|
||||||
edict_t *t;
|
edict_t *t;
|
||||||
edict_t *master;
|
edict_t *master;
|
||||||
qboolean done = false;
|
|
||||||
|
|
||||||
if (!ent || !activator)
|
if (!ent || !activator)
|
||||||
{
|
{
|
||||||
|
@ -322,20 +321,17 @@ G_UseTargets(edict_t *ent, edict_t *activator)
|
||||||
/* if this entity is part of a train, cleanly remove it */
|
/* if this entity is part of a train, cleanly remove it */
|
||||||
if (t->flags & FL_TEAMSLAVE)
|
if (t->flags & FL_TEAMSLAVE)
|
||||||
{
|
{
|
||||||
if (t->teammaster)
|
master = t->teammaster;
|
||||||
|
|
||||||
|
while (master)
|
||||||
{
|
{
|
||||||
master = t->teammaster;
|
if (master->teamchain == t)
|
||||||
|
|
||||||
while (!done)
|
|
||||||
{
|
{
|
||||||
if (master->teamchain == t)
|
master->teamchain = t->teamchain;
|
||||||
{
|
break;
|
||||||
master->teamchain = t->teamchain;
|
|
||||||
done = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
master = master->teamchain;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
master = master->teamchain;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue