- removed variables that are not used

- some fixes on soldier direction calculations

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1403 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
lalien
2007-09-20 14:35:33 +00:00
parent 5a0abb4a14
commit ebd1e97d37
11 changed files with 36 additions and 32 deletions
@@ -1452,7 +1452,7 @@ void BeginInventoryPoolPtr( OBJECTTYPE *pInventorySlot )
fMapInventoryItem = FALSE;
if ( _KeyDown ( 89 )) //Lalien: sell all items of this type on Alt+Y
{
for( UINT32 iNumber = 0; iNumber < iTotalNumberOfSlots ; ++iNumber)
for( INT32 iNumber = 0; iNumber < iTotalNumberOfSlots ; ++iNumber)
{
if ( pInventoryPoolList[ iNumber ].o.usItem == gItemPointer.usItem )
{
+1 -1
View File
@@ -247,7 +247,7 @@ UINT8 DoReinforcementAsPendingEnemy( INT16 sMapX, INT16 sMapY )
UINT16 pusMoveDir[4][3];
UINT8 ubDirNumber = 0, ubIndex;
GROUP *pGroup;
ENEMYGROUP *pEnemyGroup;
//ENEMYGROUP *pEnemyGroup;
SECTORINFO *pThisSector, *pSector;
if( !gGameExternalOptions.gfAllowReinforcements )
+2 -2
View File
@@ -623,7 +623,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel, UINT16 usHa
//TRY PUNCHING
if ( Item[ usHandItem ].usItemClass == IC_PUNCH )
{
INT16 sCnt;
//INT16 sCnt;
INT16 sSpot;
UINT8 ubGuyThere;
INT16 sGotLocation = NOWHERE;
@@ -631,7 +631,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel, UINT16 usHa
sAdjustedGridNo = NOWHERE;
ubDirection = 0xff;
for ( sCnt = 0; sCnt < NUM_WORLD_DIRECTIONS; sCnt++ )
for ( INT8 sCnt = 0; sCnt < NUM_WORLD_DIRECTIONS; sCnt++ )
{
sSpot = NewGridNo( pSoldier->sGridNo, DirectionInc( sCnt ) );
+3 -3
View File
@@ -6319,8 +6319,8 @@ BOOLEAN ValidQuickExchangePosition( )
BOOLEAN IsValidJumpLocation( SOLDIERTYPE *pSoldier, INT16 sGridNo, BOOLEAN fCheckForPath )
{
INT16 sFourGrids[4], sDistance=0, sSpot, sIntSpot;
INT16 sDirs[4] = { NORTH, EAST, SOUTH, WEST };
INT32 cnt;
INT8 sDirs[4] = { NORTH, EAST, SOUTH, WEST };
//INT32 cnt;
UINT8 ubGuyThere;
UINT8 ubMovementCost;
INT32 iDoorGridNo;
@@ -6333,7 +6333,7 @@ BOOLEAN IsValidJumpLocation( SOLDIERTYPE *pSoldier, INT16 sGridNo, BOOLEAN fChec
}
// Loop through positions...
for (cnt = 0; cnt < 4; cnt++)
for (INT8 cnt = 0; cnt < 4; cnt++)
{
// MOVE OUT TWO DIRECTIONS
sIntSpot = NewGridNo( sGridNo, DirectionInc( sDirs[ cnt ] ) );
+11 -11
View File
@@ -4586,8 +4586,8 @@ INT16 FindAdjacentGridEx( SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8 *pubDirect
// fDoor determines whether special door-handling code should be used (for interacting with doors)
INT16 sFourGrids[4], sDistance=0;
INT16 sDirs[4] = { NORTH, EAST, SOUTH, WEST };
INT32 cnt;
INT8 sDirs[4] = { NORTH, EAST, SOUTH, WEST };
//INT32 cnt;
INT16 sClosest=NOWHERE, sSpot, sOkTest;
INT16 sCloseGridNo=NOWHERE;
UINT32 uiMercFlags;
@@ -4717,15 +4717,15 @@ INT16 FindAdjacentGridEx( SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8 *pubDirect
if ( sDistance < sClosest )
{
sClosest = sDistance;
sCloseGridNo = (INT16)sGridNo;
sClosest = sDistance;
sCloseGridNo = sGridNo;
}
}
}
}
for (cnt = 0; cnt < 4; cnt++)
for (INT8 cnt = 0; cnt < 4; cnt++)
{
// MOVE OUT TWO DIRECTIONS
sFourGrids[cnt] = sSpot = NewGridNo( sGridNo, DirectionInc( sDirs[ cnt ] ) );
@@ -4874,8 +4874,8 @@ INT16 FindNextToAdjacentGridEx( SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8 *pub
// fDoor determines whether special door-handling code should be used (for interacting with doors)
INT16 sFourGrids[4], sDistance=0;
INT16 sDirs[4] = { NORTH, EAST, SOUTH, WEST };
INT32 cnt;
INT8 sDirs[4] = { NORTH, EAST, SOUTH, WEST };
//INT32 cnt;
INT16 sClosest=WORLD_MAX, sSpot, sSpot2, sOkTest;
INT16 sCloseGridNo=NOWHERE;
UINT32 uiMercFlags;
@@ -4952,7 +4952,7 @@ INT16 FindNextToAdjacentGridEx( SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8 *pub
}
for (cnt = 0; cnt < 4; cnt++)
for (INT8 cnt = 0; cnt < 4; cnt++)
{
// MOVE OUT TWO DIRECTIONS
sFourGrids[cnt] = sSpot = NewGridNo( sGridNo, DirectionInc( sDirs[ cnt ] ) );
@@ -5131,13 +5131,13 @@ INT16 FindNextToAdjacentGridEx( SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8 *pub
INT16 FindAdjacentPunchTarget( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pTargetSoldier, INT16 * psAdjustedTargetGridNo, UINT8 * pubDirection )
{
INT16 cnt;
//INT16 cnt;
INT16 sSpot;
UINT8 ubGuyThere;
for ( cnt = 0; cnt < NUM_WORLD_DIRECTIONS; cnt++ )
for ( INT8 cnt = 0; cnt < NUM_WORLD_DIRECTIONS; cnt++ )
{
sSpot = (INT16)NewGridNo( pSoldier->sGridNo, DirectionInc( cnt ) );
sSpot = NewGridNo( pSoldier->sGridNo, DirectionInc( cnt ) );
if ( DoorTravelCost( pSoldier, sSpot, gubWorldMovementCosts[ sSpot ][ cnt ][ pSoldier->bLevel ], FALSE, NULL ) >= TRAVELCOST_BLOCKED )
{
+2 -2
View File
@@ -2300,7 +2300,7 @@ INT16 PlotPath( SOLDIERTYPE *pSold, INT16 sDestGridno, INT8 bCopyRoute, INT8 bPl
// We should reduce points for starting to run if first tile is a fence...
sTestGridno = NewGridNo(pSold->sGridNo,(INT16) DirectionInc( (UINT16)guiPathingData[0]));
sTestGridno = NewGridNo(pSold->sGridNo, DirectionInc( guiPathingData[0]));
if ( gubWorldMovementCosts[ sTestGridno ][ (INT8)guiPathingData[0] ][ pSold->bLevel] == TRAVELCOST_FENCE )
{
if ( usMovementMode == RUNNING && pSold->usAnimState != RUNNING )
@@ -2354,7 +2354,7 @@ INT16 PlotPath( SOLDIERTYPE *pSold, INT16 sDestGridno, INT8 bCopyRoute, INT8 bPl
// what is the next gridno in the path?
sOldGrid = sTempGrid;
sTempGrid = NewGridNo(sTempGrid,(INT16) DirectionInc( (UINT16)guiPathingData[iCnt]));
sTempGrid = NewGridNo(sTempGrid, DirectionInc( guiPathingData[iCnt]));
// Get switch value...
sSwitchValue = gubWorldMovementCosts[ sTempGrid ][ (INT8)guiPathingData[iCnt] ][ pSold->bLevel];
+4 -4
View File
@@ -1484,7 +1484,7 @@ UINT8 MinAPsToPunch(SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8 ubAddTurningCost
INT8 MinPtsToMove(SOLDIERTYPE *pSoldier)
{
// look around all 8 directions and return lowest terrain cost
INT32 cnt;
INT8 cnt;
INT16 sLowest=127;
INT16 sGridno,sCost;
@@ -1495,10 +1495,10 @@ INT8 MinPtsToMove(SOLDIERTYPE *pSoldier)
for (cnt=0; cnt <= 7; cnt++)
{
sGridno = NewGridNo(pSoldier->sGridNo,DirectionInc((INT16) cnt));
sGridno = NewGridNo(pSoldier->sGridNo, DirectionInc( cnt ));
if (sGridno != pSoldier->sGridNo)
{
if ( (sCost=ActionPointCost( pSoldier, sGridno, (UINT8)cnt , pSoldier->usUIMovementMode ) ) < sLowest )
if ( (sCost=ActionPointCost( pSoldier, sGridno, cnt , pSoldier->usUIMovementMode ) ) < sLowest )
{
sLowest = sCost;
}
@@ -1513,7 +1513,7 @@ INT8 PtsToMoveDirection(SOLDIERTYPE *pSoldier, INT8 bDirection )
INT8 bOverTerrainType;
UINT16 usMoveModeToUse;
sGridno = NewGridNo( pSoldier->sGridNo, DirectionInc((INT16) bDirection ) );
sGridno = NewGridNo( pSoldier->sGridNo, DirectionInc( bDirection ) );
usMoveModeToUse = pSoldier->usUIMovementMode;
+1 -1
View File
@@ -2367,7 +2367,7 @@ BOOLEAN EVENT_InitNewSoldierAnim( SOLDIERTYPE *pSoldier, UINT16 usNewState, UINT
uiOldAnimFlags = gAnimControl[ pSoldier->usAnimState ].uiFlags;
uiNewAnimFlags = gAnimControl[ usNewState ].uiFlags;
usNewGridNo = NewGridNo( (UINT16)pSoldier->sGridNo, (UINT16)DirectionInc( pSoldier->usPathingData[ pSoldier->usPathIndex ] ) );
usNewGridNo = NewGridNo( pSoldier->sGridNo, DirectionInc( pSoldier->usPathingData[ pSoldier->usPathIndex ] ) );
// CHECKING IF WE HAVE A HIT FINISH BUT NO DEATH IS DONE WITH A SPECIAL ANI CODE
+4 -1
View File
@@ -369,8 +369,11 @@ void RevealRoofsAndItems(SOLDIERTYPE *pSoldier, UINT32 itemsToo, BOOLEAN fShowLo
BuildSightDir(dir,(UINT32 *)&Dir[0],(UINT32 *)&Dir[1],(UINT32 *)&Dir[2],(UINT32 *)&Dir[3],(UINT32 *)&Dir[4]);
for (cnt = 0; cnt < 5; cnt++)
Inc[cnt] = DirectionInc( (INT16)Dir[cnt]);
{
Inc[cnt] = DirectionInc( Dir[cnt] );
}
// create gridno increment for NOVIEW - in other words, no increment!
Inc[5] = 0;
+4 -3
View File
@@ -194,9 +194,9 @@ INT8 CalcBestCTGT( SOLDIERTYPE *pSoldier, UINT8 ubOppID, INT16 sOppGridNo, INT8
// using only ints for maximum execution speed here
// CJC: Well, so much for THAT idea!
INT16 sCentralGridNo, sAdjSpot, sNorthGridNo, sSouthGridNo, sDir, sCheckSpot, sOKTest;
INT16 sCentralGridNo, sAdjSpot, sNorthGridNo, sSouthGridNo, sCheckSpot, sOKTest;
INT8 bThisCTGT, bBestCTGT = 0;
UINT8 sDir = 0;
sCheckSpot = -1;
@@ -209,7 +209,8 @@ INT8 CalcBestCTGT( SOLDIERTYPE *pSoldier, UINT8 ubOppID, INT16 sOppGridNo, INT8
sSouthGridNo = NewGridNo( sCentralGridNo, DirectionInc(SOUTH) );
// look into all 8 adjacent tiles & determine where the cover is the worst
for (sDir = 1; sDir <= 8; sDir++)
// Lalien: shouldn't this start at 0 than?
for (sDir = 0; sDir < NUM_WORLD_DIRECTIONS; sDir++)
{
// get the gridno of the adjacent spot lying in that direction
sAdjSpot = NewGridNo( sCentralGridNo, DirectionInc( sDir ) );
+3 -3
View File
@@ -574,7 +574,7 @@ INT16 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT16 sDesGrid, IN
ubDirChecked[ubDirection] = TRUE;
// determine the gridno 1 tile away from current friend in this direction
sTempDest = NewGridNo(sDesGrid,DirectionInc( (INT16)(ubDirection + 1) ));
sTempDest = NewGridNo(sDesGrid, DirectionInc( ubDirection + 1 ) );
// if that's out of bounds, ignore it & check next direction
if (sTempDest == sDesGrid)
@@ -625,8 +625,8 @@ INT16 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT16 sDesGrid, IN
{
// what is the next gridno in the path?
//sTempDest = NewGridNo( sGoToGrid,DirectionInc( (INT16) (pSoldier->usPathingData[sLoop] + 1) ) );
sTempDest = NewGridNo( sGoToGrid,DirectionInc( (INT16) (pSoldier->usPathingData[sLoop]) ) );
//sTempDest = NewGridNo( sGoToGrid,DirectionInc( (pSoldier->usPathingData[sLoop] + 1) ) );
sTempDest = NewGridNo( sGoToGrid, DirectionInc( pSoldier->usPathingData[sLoop] ) );
//NumMessage("sTempDest = ",sTempDest);
// this should NEVER be out of bounds