mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-11 18:50:46 +00:00
git-svn-id: https://svn.eduke32.com/eduke32@1020 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
d3c3b7f0e7
commit
9e39f47e0e
1 changed files with 45 additions and 26 deletions
|
@ -7003,31 +7003,40 @@ static int parse(void)
|
||||||
// -1 for none found
|
// -1 for none found
|
||||||
// <type> <maxdist> <varid>
|
// <type> <maxdist> <varid>
|
||||||
int lType=*insptr++, lMaxDist=*insptr++, lVarID=*insptr++;
|
int lType=*insptr++, lMaxDist=*insptr++, lVarID=*insptr++;
|
||||||
int lFound=-1, lTemp, j, k;
|
int lFound=-1, j, k = MAXSTATUS-1;
|
||||||
|
|
||||||
k = MAXSTATUS-1;
|
if (tw == CON_FINDNEARACTOR || tw == CON_FINDNEARACTOR3D)
|
||||||
|
k = 1;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
j=headspritestat[(tw==CON_FINDNEARACTOR||tw==CON_FINDNEARACTOR3D)?1:k]; // all sprites
|
j=headspritestat[k]; // all sprites
|
||||||
if (j == -1) continue;
|
if (tw==CON_FINDNEARSPRITE3D || tw==CON_FINDNEARACTOR3D)
|
||||||
do
|
|
||||||
{
|
{
|
||||||
if (sprite[j].picnum == lType && j != g_i)
|
while (j>=0)
|
||||||
{
|
{
|
||||||
if (tw==CON_FINDNEARACTOR3D || tw==CON_FINDNEARSPRITE3D)
|
if (sprite[j].picnum == lType && j != g_i && dist(&sprite[g_i], &sprite[j]) < lMaxDist)
|
||||||
lTemp=dist(&sprite[g_i], &sprite[j]);
|
|
||||||
else lTemp=ldist(&sprite[g_i], &sprite[j]);
|
|
||||||
if (lTemp < lMaxDist)
|
|
||||||
{
|
{
|
||||||
lFound=j;
|
lFound=j;
|
||||||
j = MAXSPRITES;
|
j = MAXSPRITES;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
j = nextspritestat[j];
|
||||||
}
|
}
|
||||||
j = nextspritestat[j];
|
|
||||||
}
|
}
|
||||||
while (j>=0);
|
else
|
||||||
if ((tw==CON_FINDNEARACTOR||tw==CON_FINDNEARACTOR3D) || j == MAXSPRITES)
|
{
|
||||||
|
while (j>=0)
|
||||||
|
{
|
||||||
|
if (sprite[j].picnum == lType && j != g_i && ldist(&sprite[g_i], &sprite[j]) < lMaxDist)
|
||||||
|
{
|
||||||
|
lFound=j;
|
||||||
|
j = MAXSPRITES;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
j = nextspritestat[j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (j == MAXSPRITES || tw == CON_FINDNEARACTOR || tw == CON_FINDNEARACTOR3D)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
while (k--);
|
while (k--);
|
||||||
|
@ -7047,31 +7056,41 @@ static int parse(void)
|
||||||
// -1 for none found
|
// -1 for none found
|
||||||
// <type> <maxdistvarid> <varid>
|
// <type> <maxdistvarid> <varid>
|
||||||
int lType=*insptr++, lMaxDist=GetGameVarID(*insptr++, g_i, g_p), lVarID=*insptr++;
|
int lType=*insptr++, lMaxDist=GetGameVarID(*insptr++, g_i, g_p), lVarID=*insptr++;
|
||||||
int lFound=-1, lTemp, j, k;
|
int lFound=-1, j, k = MAXSTATUS-1;
|
||||||
|
|
||||||
|
if (tw == CON_FINDNEARACTORVAR || tw == CON_FINDNEARACTOR3DVAR)
|
||||||
|
k = 1;
|
||||||
|
|
||||||
k=MAXSTATUS-1;
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
j=headspritestat[(tw==CON_FINDNEARACTORVAR||tw==CON_FINDNEARACTOR3DVAR)?1:k]; // all sprites
|
j=headspritestat[k]; // all sprites
|
||||||
if (j == -1) continue;
|
if (tw==CON_FINDNEARACTOR3DVAR || tw==CON_FINDNEARSPRITE3DVAR)
|
||||||
do
|
|
||||||
{
|
{
|
||||||
if (sprite[j].picnum == lType && j != g_i)
|
while (j >= 0)
|
||||||
{
|
{
|
||||||
if (tw==CON_FINDNEARACTOR3DVAR || tw==CON_FINDNEARSPRITE3DVAR)
|
if (sprite[j].picnum == lType && j != g_i && dist(&sprite[g_i], &sprite[j]) < lMaxDist)
|
||||||
lTemp=dist(&sprite[g_i], &sprite[j]);
|
|
||||||
else lTemp=ldist(&sprite[g_i], &sprite[j]);
|
|
||||||
if (lTemp < lMaxDist)
|
|
||||||
{
|
{
|
||||||
lFound=j;
|
lFound=j;
|
||||||
j = MAXSPRITES;
|
j = MAXSPRITES;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
j = nextspritestat[j];
|
||||||
}
|
}
|
||||||
j = nextspritestat[j];
|
|
||||||
}
|
}
|
||||||
while (j >= 0);
|
else
|
||||||
if ((tw==CON_FINDNEARACTORVAR||tw==CON_FINDNEARACTOR3DVAR) || j == MAXSPRITES)
|
{
|
||||||
|
while (j >= 0)
|
||||||
|
{
|
||||||
|
if (sprite[j].picnum == lType && j != g_i && ldist(&sprite[g_i], &sprite[j]) < lMaxDist)
|
||||||
|
{
|
||||||
|
lFound=j;
|
||||||
|
j = MAXSPRITES;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
j = nextspritestat[j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (j == MAXSPRITES || tw==CON_FINDNEARACTORVAR || tw==CON_FINDNEARACTOR3DVAR)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
while (k--);
|
while (k--);
|
||||||
|
|
Loading…
Reference in a new issue