Initialized many variables

Fix for enemy invasions and reinforcements


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1192 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Overhaul
2007-08-13 03:39:54 +00:00
parent ca8cb7b89a
commit 6ec2c5da7d
79 changed files with 2621 additions and 2584 deletions
+15 -14
View File
@@ -346,6 +346,10 @@ void CreateJA2SelectionWindow( INT16 sWhat )
pSelList = SelRoom;
pNumSelList = &iNumRoomsSelected;
break;
default:
// If none of these, don't create anything!
AssertMsg( 0, "Unknown window creation type");
return;
}
BuildDisplayWindow( pDSpec, usNSpecs, &pDispList, &SelWinStartPoint, &SelWinEndPoint,
@@ -1086,21 +1090,19 @@ void DisplaySelectionWindowGraphicalInformation()
//
void AddToSelectionList( DisplayList *pNode )
{
INT32 iIndex, iUseIndex;
BOOLEAN fDone;
INT32 iIndex, iUseIndex = -1;
fDone = FALSE;
for (iIndex = 0; iIndex < (*pNumSelList) && !fDone; iIndex++ )
for (iIndex = 0; iIndex < (*pNumSelList); iIndex++ )
{
if ( pNode->uiObjIndx == pSelList[ iIndex ].uiObject &&
pNode->uiIndex == pSelList[ iIndex ].usIndex )
{
fDone = TRUE;
iUseIndex = iIndex;
break;
}
}
if ( fDone )
if ( iUseIndex >= 0 )
{
// Was already in the list, so bump up the count
pSelList[ iUseIndex ].sCount++;
@@ -1158,26 +1160,25 @@ BOOLEAN ClearSelectionList( void )
//
BOOLEAN RemoveFromSelectionList( DisplayList *pNode )
{
INT32 iIndex, iUseIndex;
BOOLEAN fDone, fRemoved;
INT32 iIndex, iUseIndex = -1;
BOOLEAN fRemoved;
// Abort if no entries in list (pretend we removed a node)
if ( (*pNumSelList) <= 0 )
return( TRUE );
fRemoved = FALSE;
fDone = FALSE;
for (iIndex = 0; iIndex < (*pNumSelList) && !fDone; iIndex++ )
for (iIndex = 0; iIndex < (*pNumSelList); iIndex++ )
{
if ( pNode->uiObjIndx == pSelList[ iIndex ].uiObject &&
pNode->uiIndex == pSelList[ iIndex ].usIndex )
{
fDone = TRUE;
iUseIndex = iIndex;
break;
}
}
if ( fDone )
if ( iUseIndex >= 0 )
{
// Was already in the list, so bump up the count
pSelList[ iUseIndex ].sCount--;
@@ -1613,7 +1614,7 @@ BOOLEAN DisplayWindowFunc( DisplayList *pNode, INT16 iTopCutOff, INT16 iBottomCu
fReturnVal = FALSE;
if (DisplayWindowFunc(pNode->pNext, iTopCutOff, iBottomCutOff, pUpperLeft, fFlags))
{
iCurrY = pUpperLeft->iY + pNode->iY - iTopCutOff;
iCurrY = (INT16) pUpperLeft->iY + pNode->iY - iTopCutOff;
if ( iCurrY > iBottomCutOff )
return(TRUE);