Fixed a problem in CON_FINDNEARACTOR3D and optimized findnearactor3d/findnearactor3dvar/findnearsprite3d/findnearsprite3dvar

git-svn-id: https://svn.eduke32.com/eduke32@44 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-04-17 22:02:10 +00:00
parent 972e60b5f8
commit ea46fa145e
2 changed files with 8 additions and 8 deletions

View file

@ -8582,7 +8582,7 @@ char opendemoread(char which_demo) // 0 = mine
if (kread(recfilep,&ud.reccnt,sizeof(long)) != sizeof(long)) goto corrupt; if (kread(recfilep,&ud.reccnt,sizeof(long)) != sizeof(long)) goto corrupt;
if (kread(recfilep,&ver,sizeof(char)) != sizeof(char)) goto corrupt; if (kread(recfilep,&ver,sizeof(char)) != sizeof(char)) goto corrupt;
if(ver != BYTEVERSION && ver != 160 && ver != 116 && ver != 117) { /* old demo playback */ if(ver != BYTEVERSION && ver != 160 /*&& ver != 116 && ver != 117*/) { /* old demo playback */
if (ver == BYTEVERSION_JF) initprintf("Demo %s is for Regular edition.\n", d); if (ver == BYTEVERSION_JF) initprintf("Demo %s is for Regular edition.\n", d);
else if (ver == BYTEVERSION_JF+1) initprintf("Demo %s is for Atomic edition.\n", d); else if (ver == BYTEVERSION_JF+1) initprintf("Demo %s is for Atomic edition.\n", d);
else if (ver == BYTEVERSION_JF+2) initprintf("Demo %s is for Shareware version.\n", d); else if (ver == BYTEVERSION_JF+2) initprintf("Demo %s is for Shareware version.\n", d);

View file

@ -5365,10 +5365,10 @@ good:
if(sprite[j].picnum == lType && j != g_i) if(sprite[j].picnum == lType && j != g_i)
{ {
lTemp=ldist(&sprite[g_i], &sprite[j]); lTemp=ldist(&sprite[g_i], &sprite[j]);
lTemp2=txdist(&sprite[g_i], &sprite[j]); if(lTemp < lMaxDist && lTemp < lDist)
if( (lTemp < lMaxDist) && (lTemp2 < lMaxZDist) )
{ {
if (lTemp < lDist) lTemp2=txdist(&sprite[g_i], &sprite[j]);
if (lTemp2 < lMaxZDist)
{ {
lFound=j; lFound=j;
j = MAXSPRITES; j = MAXSPRITES;
@ -5416,10 +5416,10 @@ good:
if(sprite[j].picnum == lType && j != g_i) if(sprite[j].picnum == lType && j != g_i)
{ {
lTemp=ldist(&sprite[g_i], &sprite[j]); lTemp=ldist(&sprite[g_i], &sprite[j]);
lTemp2=txdist(&sprite[g_i], &sprite[j]); if(lTemp < lMaxDist && lTemp < lDist)
if( (lTemp < lMaxDist) && (lTemp2 < lMaxZDist) )
{ {
if (lTemp < lDist) lTemp2=txdist(&sprite[g_i], &sprite[j]);
if (lTemp2 < lMaxZDist)
{ {
lFound=j; lFound=j;
j = MAXSPRITES; j = MAXSPRITES;
@ -5429,7 +5429,7 @@ good:
} }
j = nextspritestat[j]; j = nextspritestat[j];
} }
if(tw==CON_FINDNEARACTOR3DVAR || j == MAXSPRITES) if(tw==CON_FINDNEARACTOR3D || j == MAXSPRITES)
break; break;
} }
SetGameVarID(lVarID, lFound, g_i, g_p); SetGameVarID(lVarID, lFound, g_i, g_p);