mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Fix for "bullets too high" sanity check in tilesets with non-zero floor height causing bullets to disappear when firing at roof from too steep degree. + fixed extra parameters inserted into debug messages (compiler warning) (by Shadooow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9013 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+17
-6
@@ -5481,8 +5481,7 @@ INT8 FireBulletGivenTarget( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOA
|
||||
ddHorizAngle, ddVerticAngle,
|
||||
pFirer->ubID, ubLoop, ubShots,
|
||||
gpSpreadPattern[ubSpreadIndex].method, gSpreadPatternMethodNames[gpSpreadPattern[ubSpreadIndex].method],
|
||||
ubSpreadIndex, gpSpreadPattern[ubSpreadIndex].Name,
|
||||
NULL
|
||||
ubSpreadIndex, gpSpreadPattern[ubSpreadIndex].Name
|
||||
);
|
||||
fclose(OutFile);
|
||||
}
|
||||
@@ -6136,8 +6135,7 @@ INT8 FireBulletGivenTargetTrapOnly( SOLDIERTYPE* pThrower, OBJECTTYPE* pObj, INT
|
||||
ddHorizAngle, ddVerticAngle,
|
||||
NOBODY, ubLoop, ubShots,
|
||||
gpSpreadPattern[ubSpreadIndex].method, gSpreadPatternMethodNames[gpSpreadPattern[ubSpreadIndex].method],
|
||||
ubSpreadIndex, gpSpreadPattern[ubSpreadIndex].Name,
|
||||
NULL
|
||||
ubSpreadIndex, gpSpreadPattern[ubSpreadIndex].Name
|
||||
);
|
||||
fclose(OutFile);
|
||||
}
|
||||
@@ -6898,7 +6896,7 @@ void MoveBullet( INT32 iBullet )
|
||||
// check a particular tile
|
||||
// retrieve values from world for this particular tile
|
||||
iGridNo = pBullet->iCurrTileX + pBullet->iCurrTileY * WORLD_COLS;
|
||||
if (!GridNoOnVisibleWorldTile( iGridNo ) || (pBullet->iCurrCubesZ > PROFILE_Z_SIZE * 2 && FIXEDPT_TO_INT32( pBullet->qIncrZ ) > 0 ) )
|
||||
if (!GridNoOnVisibleWorldTile( iGridNo ))
|
||||
{
|
||||
// bullet outside of world!
|
||||
// NB remove bullet only flags a bullet for deletion; we still have access to the
|
||||
@@ -6921,6 +6919,18 @@ void MoveBullet( INT32 iBullet )
|
||||
// calculate which level bullet is on for suppression and close call purposes
|
||||
// figure out the LOS cube level of the current point
|
||||
iCurrCubesAboveLevelZ = CONVERT_HEIGHTUNITS_TO_INDEX( FIXEDPT_TO_INT32( pBullet->qCurrZ - qLandHeight) );
|
||||
if ((iCurrCubesAboveLevelZ > STRUCTURE_ON_ROOF_MAX && FIXEDPT_TO_INT32( pBullet->qIncrZ ) > 0 ))
|
||||
{
|
||||
// bullet too high
|
||||
// NB remove bullet only flags a bullet for deletion; we still have access to the
|
||||
// information in the structure
|
||||
RemoveBullet(pBullet->iBullet);
|
||||
|
||||
if (ENABLE_COLLISION)
|
||||
BulletMissed(pBullet, pBullet->pFirer);//only if local origin
|
||||
|
||||
return;
|
||||
}
|
||||
// figure out the level
|
||||
if (iCurrCubesAboveLevelZ < STRUCTURE_ON_GROUND_MAX)
|
||||
{
|
||||
@@ -7714,7 +7724,8 @@ void MoveBullet( INT32 iBullet )
|
||||
}
|
||||
} while( (pBullet->iCurrTileX == iOldTileX) && (pBullet->iCurrTileY == iOldTileY));
|
||||
|
||||
if ( !GridNoOnVisibleWorldTile( (pBullet->iCurrTileX + pBullet->iCurrTileY * WORLD_COLS) ) || (pBullet->iCurrCubesZ > PROFILE_Z_SIZE * 2 && FIXEDPT_TO_INT32( pBullet->qIncrZ ) > 0 ) )
|
||||
iCurrCubesAboveLevelZ = CONVERT_HEIGHTUNITS_TO_INDEX(FIXEDPT_TO_INT32(pBullet->qCurrZ - qLandHeight));
|
||||
if ( !GridNoOnVisibleWorldTile( (pBullet->iCurrTileX + pBullet->iCurrTileY * WORLD_COLS) ) || (iCurrCubesAboveLevelZ > STRUCTURE_ON_ROOF_MAX && FIXEDPT_TO_INT32( pBullet->qIncrZ ) > 0 ) )
|
||||
{
|
||||
// bullet outside of world!
|
||||
RemoveBullet( pBullet->iBullet );
|
||||
|
||||
Reference in New Issue
Block a user