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
+1 -1
View File
@@ -532,7 +532,7 @@ void HandleDialogue( )
}
}
// OK, check if we are still taking
// OK, check if we are still talking
if ( gpCurrentTalkingFace != NULL )
{
if ( gpCurrentTalkingFace->fTalking )
+1 -1
View File
@@ -35,7 +35,7 @@
#include "Scheduling.h"
#endif
BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *pNode );
BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *pNode, GROUP *pGroup = NULL );
BOOLEAN CountNumberOfElitesRegularsAdminsAndCreaturesFromEnemySoldiersTempFile( UINT8 *pubNumElites, UINT8 *pubNumRegulars, UINT8 *pubNumAdmins, UINT8 *pubNumCreatures );
+1 -1
View File
@@ -294,7 +294,7 @@ void InteractWithOpenableStruct( SOLDIERTYPE *pSoldier, STRUCTURE *pStructure, U
{
STRUCTURE * pBaseStructure;
BOOLEAN fDoMenu = FALSE;
DOOR * pDoor;
DOOR * pDoor = NULL;
DOOR_STATUS * pDoorStatus;
BOOLEAN fTrapsFound = FALSE;
+134 -133
View File
@@ -1,65 +1,65 @@
#ifdef PRECOMPILEDHEADERS
#include "Tactical All.h"
#include "Tactical All.h"
#else
#include "items.h"
#include "Action Items.h"
#include "handle Items.h"
#include "overhead.h"
#include "weapons.h"
#include "points.h"
#include "tiledef.h"
#include "worlddef.h"
#include "worldman.h"
#include "interface.h"
#include "renderworld.h"
#include "Animation Control.h"
#include "font control.h"
#include "render dirty.h"
#include "World items.h"
#include "text.h"
#include "Timer Control.h"
#include "wcheck.h"
#include "interface items.h"
#include "physics.h"
#include "soldier profile.h"
#include "interface dialogue.h"
#include "quests.h"
#include "message.h"
#include "isometric utils.h"
#include "los.h"
#include "dialogue control.h"
#include "ai.h"
#include "soldier macros.h"
#include "interface panels.h"
#include "Strategic Town Loyalty.h"
#include "soldier functions.h"
#include "Map Screen Helicopter.h"
#include "pathai.h"
#include "fov.h"
#include "MessageBoxScreen.h"
#include "explosion control.h"
#include "SkillCheck.h"
#include "Campaign.h"
#include "Random.h"
#include "structure wrap.h"
#include "interactive tiles.h"
#include "SaveLoadMap.h"
#include "ShopKeeper Interface.h"
#include "Arms Dealer Init.h"
#include "soldier add.h"
#include "sound control.h"
#include "squads.h"
#include "rotting corpses.h"
#include "soldier ani.h"
#include "Opplist.h"
#include "qarray.h"
#include "render fun.h"
#include "environment.h"
#include "Map Information.h"
#include "GameSettings.h"
#include "end game.h"
#include "interface control.h"
#include "Map Screen Interface Map Inventory.h"
#include "items.h"
#include "Action Items.h"
#include "handle Items.h"
#include "overhead.h"
#include "weapons.h"
#include "points.h"
#include "tiledef.h"
#include "worlddef.h"
#include "worldman.h"
#include "interface.h"
#include "renderworld.h"
#include "Animation Control.h"
#include "font control.h"
#include "render dirty.h"
#include "World items.h"
#include "text.h"
#include "Timer Control.h"
#include "wcheck.h"
#include "interface items.h"
#include "physics.h"
#include "soldier profile.h"
#include "interface dialogue.h"
#include "quests.h"
#include "message.h"
#include "isometric utils.h"
#include "los.h"
#include "dialogue control.h"
#include "ai.h"
#include "soldier macros.h"
#include "interface panels.h"
#include "Strategic Town Loyalty.h"
#include "soldier functions.h"
#include "Map Screen Helicopter.h"
#include "pathai.h"
#include "fov.h"
#include "MessageBoxScreen.h"
#include "explosion control.h"
#include "SkillCheck.h"
#include "Campaign.h"
#include "Random.h"
#include "structure wrap.h"
#include "interactive tiles.h"
#include "SaveLoadMap.h"
#include "ShopKeeper Interface.h"
#include "Arms Dealer Init.h"
#include "soldier add.h"
#include "sound control.h"
#include "squads.h"
#include "rotting corpses.h"
#include "soldier ani.h"
#include "Opplist.h"
#include "qarray.h"
#include "render fun.h"
#include "environment.h"
#include "Map Information.h"
#include "GameSettings.h"
#include "end game.h"
#include "interface control.h"
#include "Map Screen Interface Map Inventory.h"
#endif
#define NUM_ITEMS_LISTED 8
@@ -182,7 +182,7 @@ BOOLEAN HandleCheckForBadChangeToGetThrough( SOLDIERTYPE *pSoldier, SOLDIERTYPE
INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 usHandItem, BOOLEAN fFromUI )
INT32 HandleItem( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel, UINT16 usHandItem, BOOLEAN fFromUI )
{
SOLDIERTYPE *pTargetSoldier = NULL;
UINT16 usSoldierIndex;
@@ -196,7 +196,6 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
BOOLEAN fAddingRaiseGunCost = FALSE;
LEVELNODE *pIntNode;
STRUCTURE *pStructure;
INT16 sGridNo;
// Remove any previous actions
@@ -207,8 +206,8 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
pSoldier->usAttackingWeapon = usHandItem;
// Find soldier flags depend on if it's our own merc firing or a NPC
//if ( FindSoldier( usGridNo, &usSoldierIndex, &uiMercFlags, FIND_SOLDIER_GRIDNO ) )
if ( ( usSoldierIndex = WhoIsThere2( usGridNo, bLevel ) ) != NO_SOLDIER )
//if ( FindSoldier( sGridNo, &usSoldierIndex, &uiMercFlags, FIND_SOLDIER_GRIDNO ) )
if ( ( usSoldierIndex = WhoIsThere2( sGridNo, bLevel ) ) != NO_SOLDIER )
{
pTargetSoldier = MercPtrs[ usSoldierIndex ];
@@ -232,10 +231,10 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
gTacticalStatus.ubAttackBusyCount = 0;
}
// if ( pTargetSoldier )
// {
// pTargetSoldier->bBeingAttackedCount = 0;
// }
// if ( pTargetSoldier )
// {
// pTargetSoldier->bBeingAttackedCount = 0;
// }
// Check our soldier's life for unconscious!
@@ -376,7 +375,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
}
else
{
sTargetGridNo = usGridNo;
sTargetGridNo = sGridNo;
}
// If it's a player guy, check ChanceToGetThrough to play quote
@@ -626,6 +625,8 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
UINT8 ubGuyThere;
INT16 sGotLocation = NOWHERE;
BOOLEAN fGotAdjacent = FALSE;
sAdjustedGridNo = NOWHERE;
ubDirection = 0xff;
for ( sCnt = 0; sCnt < NUM_WORLD_DIRECTIONS; sCnt++ )
{
@@ -654,7 +655,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
if ( sGotLocation == NOWHERE )
{
// See if we can get there to punch
sActionGridNo = FindAdjacentGridEx( pSoldier, usGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
if ( sActionGridNo != -1 )
{
// OK, we've got somebody...
@@ -667,9 +668,9 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
// Did we get a loaction?
if ( sGotLocation != NOWHERE )
{
pSoldier->sTargetGridNo = usGridNo;
pSoldier->sTargetGridNo = sGridNo;
pSoldier->usActionData = usGridNo;
pSoldier->usActionData = sGridNo;
// CHECK IF WE ARE AT THIS GRIDNO NOW
if ( pSoldier->sGridNo != sGotLocation && fGotAdjacent )
{
@@ -710,7 +711,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
if (gTacticalStatus.fAutoBandageMode)
{
usMapPos = usGridNo;
usMapPos = sGridNo;
}
else
{
@@ -718,7 +719,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
}
// See if we can get there to stab
sActionGridNo = FindAdjacentGridEx( pSoldier, usGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
if ( sActionGridNo == -1 )
{
// Try another location...
@@ -762,7 +763,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
}
else
{
pSoldier->sPendingActionData2 = usGridNo;
pSoldier->sPendingActionData2 = sGridNo;
}
}
pSoldier->bPendingActionData3 = ubDirection;
@@ -792,7 +793,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
if ( Item[usHandItem].wirecutters && pTargetSoldier == NULL ) // Madd: quick fix to allow wirecutter/knives
{
// See if we can get there to stab
sActionGridNo = FindAdjacentGridEx( pSoldier, usGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
if ( sActionGridNo != -1 )
{
// Calculate AP costs...
@@ -847,7 +848,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
INT16 sVehicleGridNo=-1;
// For repair, check if we are over a vehicle, then get gridnot to edge of that vehicle!
if ( IsRepairableStructAtGridNo( usGridNo, &ubMercID ) == 2 )
if ( IsRepairableStructAtGridNo( sGridNo, &ubMercID ) == 2 )
{
INT16 sNewGridNo;
UINT8 ubDirection;
@@ -856,7 +857,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
if ( sNewGridNo != NOWHERE )
{
usGridNo = sNewGridNo;
sGridNo = sNewGridNo;
sVehicleGridNo = MercPtrs[ ubMercID ]->sGridNo;
@@ -865,7 +866,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
}
// See if we can get there to stab
sActionGridNo = FindAdjacentGridEx( pSoldier, usGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
if ( sActionGridNo != -1 )
{
@@ -925,7 +926,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
INT16 sVehicleGridNo=-1;
// For repair, check if we are over a vehicle, then get gridnot to edge of that vehicle!
if ( IsRefuelableStructAtGridNo( usGridNo, &ubMercID ) )
if ( IsRefuelableStructAtGridNo( sGridNo, &ubMercID ) )
{
INT16 sNewGridNo;
UINT8 ubDirection;
@@ -934,7 +935,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
if ( sNewGridNo != NOWHERE )
{
usGridNo = sNewGridNo;
sGridNo = sNewGridNo;
sVehicleGridNo = MercPtrs[ ubMercID ]->sGridNo;
@@ -942,7 +943,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
}
// See if we can get there to stab
sActionGridNo = FindAdjacentGridEx( pSoldier, usGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
if ( sActionGridNo != -1 )
{
@@ -995,7 +996,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
if ( Item[usHandItem].jar )
{
sActionGridNo = FindAdjacentGridEx( pSoldier, usGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
if ( sActionGridNo != -1 )
{
@@ -1049,12 +1050,12 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
LEVELNODE *pIntTile;
// Get structure info for in tile!
pIntTile = GetCurInteractiveTileGridNoAndStructure( (INT16 *)&usGridNo, &pStructure );
pIntTile = GetCurInteractiveTileGridNoAndStructure( (INT16 *)&sGridNo, &pStructure );
// We should not have null here if we are given this flag...
if ( pIntTile != NULL )
{
sActionGridNo = FindAdjacentGridEx( pSoldier, usGridNo, &ubDirection, &sAdjustedGridNo, FALSE, TRUE );
sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, FALSE, TRUE );
if ( sActionGridNo != -1 )
{
@@ -1069,7 +1070,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
{
// SEND PENDING ACTION
pSoldier->ubPendingAction = MERC_ATTACH_CAN;
pSoldier->sPendingActionData2 = usGridNo;
pSoldier->sPendingActionData2 = sGridNo;
pSoldier->bPendingActionData3 = ubDirection;
pSoldier->ubPendingActionAnimCount = 0;
@@ -1078,7 +1079,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
}
else
{
EVENT_SoldierBeginTakeBlood( pSoldier, usGridNo, ubDirection );
EVENT_SoldierBeginTakeBlood( pSoldier, sGridNo, ubDirection );
}
// OK, set UI
@@ -1125,7 +1126,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
else // detonator
{
// Save gridno....
pSoldier->sPendingActionData2 = usGridNo;
pSoldier->sPendingActionData2 = sGridNo;
EVENT_SoldierBeginUseDetonator( pSoldier );
@@ -1164,16 +1165,16 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
if ( fDropBomb )
{
// Save gridno....
pSoldier->sPendingActionData2 = usGridNo;
pSoldier->sPendingActionData2 = sGridNo;
if ( pSoldier->sGridNo != usGridNo )
if ( pSoldier->sGridNo != sGridNo )
{
// SEND PENDING ACTION
pSoldier->ubPendingAction = MERC_DROPBOMB;
pSoldier->ubPendingActionAnimCount = 0;
// WALK UP TO DEST FIRST
EVENT_InternalGetNewSoldierPath( pSoldier, usGridNo, pSoldier->usUIMovementMode, FALSE, TRUE );
EVENT_InternalGetNewSoldierPath( pSoldier, sGridNo, pSoldier->usUIMovementMode, FALSE, TRUE );
}
else
{
@@ -1197,19 +1198,19 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
// See if we can get there to stab
if ( pSoldier->ubBodyType == BLOODCAT )
{
sActionGridNo = FindNextToAdjacentGridEx( pSoldier, usGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
sActionGridNo = FindNextToAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
}
else if ( CREATURE_OR_BLOODCAT( pSoldier ) && PythSpacesAway( pSoldier->sGridNo, usGridNo ) > 1 )
else if ( CREATURE_OR_BLOODCAT( pSoldier ) && PythSpacesAway( pSoldier->sGridNo, sGridNo ) > 1 )
{
sActionGridNo = FindNextToAdjacentGridEx( pSoldier, usGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
sActionGridNo = FindNextToAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
if (sActionGridNo == -1)
{
sActionGridNo = FindAdjacentGridEx( pSoldier, usGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
}
}
else
{
sActionGridNo = FindAdjacentGridEx( pSoldier, usGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
}
if ( sActionGridNo != -1 )
@@ -1260,7 +1261,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
//pSoldier->sLastTarget = sTargetGridNo;
//pSoldier->ubTargetID = WhoIsThere2( sTargetGridNo, pSoldier->bTargetLevel );
// gTacticalStatus.ubAttackBusyCount++;
// gTacticalStatus.ubAttackBusyCount++;
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("!!!!!!! Starting swipe attack, incrementing a.b.c in HandleItems to %d", gTacticalStatus.ubAttackBusyCount) );
DebugAttackBusy( "Swipe attack\n");
@@ -1290,7 +1291,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
}
else
{
sTargetGridNo = usGridNo;
sTargetGridNo = sGridNo;
}
sAPCost = MinAPsToAttack( pSoldier, sTargetGridNo, TRUE );
@@ -1347,7 +1348,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
pSoldier->ubTargetID = WhoIsThere2( sTargetGridNo, pSoldier->bTargetLevel );
// Increment attack counter...
// gTacticalStatus.ubAttackBusyCount++;
// gTacticalStatus.ubAttackBusyCount++;
DebugAttackBusy( "Weapon fire\n");
@@ -1384,7 +1385,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
// Found detonator...
if ( IsDetonatorAttached ( &(pSoldier->inv[ usHandItem ] ) ) || IsRemoteDetonatorAttached( &(pSoldier->inv[ usHandItem ] ) ) )
{
StartBombMessageBox( pSoldier, usGridNo );
StartBombMessageBox( pSoldier, sGridNo );
if ( fFromUI )
{
@@ -1513,22 +1514,22 @@ void HandleSoldierThrowItem( SOLDIERTYPE *pSoldier, INT16 sGridNo )
//<SB> crouch throwing
case ANIM_PRONE:
if ( sGridNo == pSoldier->sGridNo )
if ( sGridNo == pSoldier->sGridNo )
{
// OK, JUST DROP ITEM!
if ( pSoldier->pTempObject != NULL )
{
// OK, JUST DROP ITEM!
if ( pSoldier->pTempObject != NULL )
{
AddItemToPool( sGridNo, pSoldier->pTempObject, 1, pSoldier->bLevel, 0, -1 );
NotifySoldiersToLookforItems( );
AddItemToPool( sGridNo, pSoldier->pTempObject, 1, pSoldier->bLevel, 0, -1 );
NotifySoldiersToLookforItems( );
MemFree( pSoldier->pTempObject );
pSoldier->pTempObject = NULL;
}
break;
MemFree( pSoldier->pTempObject );
pSoldier->pTempObject = NULL;
}
ChangeSoldierStance( pSoldier, ANIM_CROUCH );
break;
}
ChangeSoldierStance( pSoldier, ANIM_CROUCH );
case ANIM_CROUCH:
case ANIM_CROUCH:
// CHECK IF WE ARE NOT ON THE SAME GRIDNO
if ( sGridNo == pSoldier->sGridNo )
{
@@ -1544,18 +1545,18 @@ void HandleSoldierThrowItem( SOLDIERTYPE *pSoldier, INT16 sGridNo )
}
else
{
// CHANGE DIRECTION AT LEAST
// CHANGE DIRECTION AT LEAST
ubDirection = (UINT8)GetDirectionFromGridNo( sGridNo, pSoldier );
SoldierGotoStationaryStance( pSoldier );
SoldierGotoStationaryStance( pSoldier );
EVENT_SetSoldierDesiredDirection( pSoldier, ubDirection );
pSoldier->fTurningUntilDone = TRUE;
pSoldier->fTurningUntilDone = TRUE;
pSoldier->usPendingAnimation = THROW_ITEM_CROUCHED;
pSoldier->usPendingAnimation = THROW_ITEM_CROUCHED;
}
break;
//</SB>
break;
//</SB>
}
}
@@ -3474,17 +3475,17 @@ BOOLEAN DrawItemPoolList( ITEM_POOL *pItemPool, INT16 sGridNo, UINT8 bCommand, I
// Set string
if ( cnt == gbCurrentItemSel )
{
SetFontForeground( FONT_MCOLOR_LTGRAY );
}
else
{
SetFontForeground( FONT_MCOLOR_DKGRAY );
}
SetFontForeground( FONT_MCOLOR_LTGRAY );
}
else
{
SetFontForeground( FONT_MCOLOR_DKGRAY );
}
swprintf( pStr, TacticalStr[ ITEMPOOL_POPUP_MORE_STR ] );
gprintfdirty( sFontX, sY, pStr );
mprintf( sFontX, sY, pStr );
}
}
gprintfdirty( sFontX, sY, pStr );
mprintf( sFontX, sY, pStr );
}
}
return( fSelectionDone );
@@ -5244,7 +5245,7 @@ INT16 FindNearestAvailableGridNoForItem( INT16 sSweetGridNo, INT8 ubRadius )
//create dummy soldier, and use the pathing to determine which nearby slots are
//reachable.
// WDS - Clean up inventory handling
// WDS - Clean up inventory handling
//memset( &soldier, 0, SIZEOF_SOLDIERTYPE );
soldier.initialize();
soldier.bTeam = 1;
@@ -5351,7 +5352,7 @@ BOOLEAN CanPlayerUseRocketRifle( SOLDIERTYPE *pSoldier, BOOLEAN fDisplay )
UINT8 StealItems(SOLDIERTYPE* pSoldier,SOLDIERTYPE* pOpponent, UINT8* ubIndexRet)
{
UINT8 ubCount=0;
ITEM_POOL *pItemPool,*pTempItemPool,*pTempLastItemPool;
ITEM_POOL *pItemPool,*pTempItemPool,*pTempLastItemPool = NULL;
OBJECTTYPE *pObject;
UINT8 i;
BOOLEAN fStealItem = FALSE;
@@ -5362,7 +5363,7 @@ UINT8 StealItems(SOLDIERTYPE* pSoldier,SOLDIERTYPE* pOpponent, UINT8* ubIndexRet
{
fStealItem = FALSE;
// WDS - Clean up inventory handling
// WDS - Clean up inventory handling
pObject=&pOpponent->inv[i];
if (pObject->usItem!=0)
{
@@ -5478,9 +5479,9 @@ void SoldierStealItemFromSoldier( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent,
cnt++;
if ( fPickup )
{
// WDS - Clean up inventory handling
// WDS - Clean up inventory handling
// Make copy of item
// memcpy( &Object, pOpponent->inv+pTempItemPool->iItemIndex, sizeof( OBJECTTYPE ) );
// memcpy( &Object, pOpponent->inv+pTempItemPool->iItemIndex, sizeof( OBJECTTYPE ) );
Object = pOpponent->inv[pTempItemPool->iItemIndex];
if ( ItemIsCool( &Object ) )
{
+1 -1
View File
@@ -82,7 +82,7 @@ typedef struct
// WDS - Clean up inventory handling
class SOLDIERTYPE;
INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 usHandItem, BOOLEAN fFromUI );
INT32 HandleItem( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel, UINT16 usHandItem, BOOLEAN fFromUI );
void SoldierPickupItem( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT16 sGridNo, INT8 bZLevel );
void HandleSoldierPickupItem( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT16 sGridNo, INT8 bZLevel );
void HandleFlashingItems( );
+1 -1
View File
@@ -3597,7 +3597,7 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
case NPC_ACTION_START_DOCTORING:
{
// reset fact he is expecting money fromt he player
// reset fact he is expecting money fromt the player
SetFactFalse( FACT_VINCE_EXPECTING_MONEY );
// check fact
+24 -21
View File
@@ -2009,7 +2009,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
{
UINT16 uiStringLength;
INVTYPE *pItem;
ETRLEObject *pTrav;
ETRLEObject *pTrav;
UINT32 usHeight, usWidth;
INT16 sCenX, sCenY, sNewY, sNewX;
HVOBJECT hVObject;
@@ -2050,7 +2050,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
// Shadow area
if(gGameSettings.fOptions[ TOPTION_SHOW_ITEM_SHADOW ]) BltVideoObjectOutlineShadowFromIndex( uiBuffer, GetInterfaceGraphicForItem( pItem ), pItem->ubGraphicNum, sCenX - 2, sCenY + 2 );
BltVideoObjectOutlineFromIndex( uiBuffer, GetInterfaceGraphicForItem( pItem ), pItem->ubGraphicNum, sCenX, sCenY, sOutlineColor, fOutline );
@@ -2106,7 +2106,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
// SetFontForeground( FONT_MCOLOR_DKGRAY );
// break;
//}
swprintf( pStr, L"%d", pObject->ubGunShotsLeft );
if ( uiBuffer == guiSAVEBUFFER )
@@ -2234,7 +2234,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
}
mprintf( sNewX, sNewY, pStr );
gprintfinvalidate( sNewX, sNewY, pStr );
}
@@ -2266,6 +2266,10 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
sFontY = sY + 1;
gprintfinvalidate( sFontX, sFontY, pStr );
// Squelch the compiler warnings
sFontX2 = sX;
sFontY2 = sY;
if ( fLineSplit )
{
VarFindFontCenterCoordinates( sX, sY, sWidth, sHeight , ITEM_FONT, &sFontX2, &sFontY2, pStr2 );
@@ -2273,25 +2277,24 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
gprintfinvalidate( sFontX2, sFontY2, pStr2 );
}
}
if ( *pubHighlightCounter == 2 )
{
mprintf( sFontX, sFontY, pStr );
if ( fLineSplit )
if ( *pubHighlightCounter == 2 )
{
mprintf( sFontX2, sFontY2, pStr2 );
mprintf( sFontX, sFontY, pStr );
if ( fLineSplit )
{
mprintf( sFontX2, sFontY2, pStr2 );
}
}
}
else if ( *pubHighlightCounter == 1 )
{
*pubHighlightCounter = 0;
gprintfRestore( sFontX, sFontY, pStr );
if ( fLineSplit )
else if ( *pubHighlightCounter == 1 )
{
gprintfRestore( sFontX2, sFontY2, pStr2 );
*pubHighlightCounter = 0;
gprintfRestore( sFontX, sFontY, pStr );
if ( fLineSplit )
{
gprintfRestore( sFontX2, sFontY2, pStr2 );
}
}
}
}
@@ -4117,7 +4120,7 @@ void DeleteItemDescriptionBox( )
{
INT32 cnt, cnt2;
BOOLEAN fFound, fAllFound;
UINT8 ubAPCost;
UINT8 ubAPCost = 0;
if( gfInItemDescBox == FALSE )
{
+1 -1
View File
@@ -1827,7 +1827,7 @@ void RenderSMPanel( BOOLEAN *pfDirty )
INT16 sFontX, sFontY;
INT16 usX, usY;
CHAR16 sString[9];
UINT32 cnt;
UINT32 cnt = 0xff000000; // Give a value that ought to crash it if this is really undefined for the robot
static CHAR16 pStr[ 200 ], pMoraleStr[ 20 ];
if ( gubSelectSMPanelToMerc != NOBODY )
+26 -18
View File
@@ -2968,7 +2968,7 @@ BOOLEAN AddTopMessage( UINT8 ubType, STR16 pzString )
void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
{
UINT32 uiBAR, uiPLAYERBAR, uiINTBAR;
VOBJECT_DESC VObjectDesc;
VOBJECT_DESC VObjectDesc;
INT16 sX, sY;
INT32 cnt2;
INT16 sBarX = 0;
@@ -2983,7 +2983,7 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
if (iResolution == 0)
{
FilenameForBPP("INTERFACE\\rect.sti", VObjectDesc.ImageFile);
FilenameForBPP("INTERFACE\\rect.sti", VObjectDesc.ImageFile);
}
else if (iResolution == 1)
{
@@ -2993,6 +2993,11 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
{
FilenameForBPP("INTERFACE\\rect_1024x768.sti", VObjectDesc.ImageFile);
}
else
{
AssertMsg( 0, "Invalid resolution");
return;
}
if( !AddVideoObject( &VObjectDesc, &uiBAR ) )
AssertMsg(0, "Missing INTERFACE\\rect.sti" );
@@ -3003,40 +3008,44 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
if (iResolution == 0)
{
FilenameForBPP("INTERFACE\\timebargreen.sti", VObjectDesc.ImageFile);
if( !AddVideoObject( &VObjectDesc, &uiPLAYERBAR ) )
AssertMsg(0, "Missing INTERFACE\\timebargreen.sti" );
}
else if (iResolution == 1)
{
FilenameForBPP("INTERFACE\\timebargreen_800x600.sti", VObjectDesc.ImageFile);
if( !AddVideoObject( &VObjectDesc, &uiPLAYERBAR ) )
AssertMsg(0, "Missing INTERFACE\\timebargreen_800x600.sti" );
}
else if (iResolution == 2)
{
FilenameForBPP("INTERFACE\\timebargreen_1024x768.sti", VObjectDesc.ImageFile);
if( !AddVideoObject( &VObjectDesc, &uiPLAYERBAR ) )
AssertMsg(0, "Missing INTERFACE\\timebargreen_1024x768.sti" );
}
else
{
AssertMsg( 0, "Invalid resolution");
return;
}
if( !AddVideoObject( &VObjectDesc, &uiPLAYERBAR ) )
AssertMsg(0, String( "Missing %s", VObjectDesc.ImageFile) );
if (iResolution == 0)
{
FilenameForBPP("INTERFACE\\timebaryellow.sti", VObjectDesc.ImageFile);
if( !AddVideoObject( &VObjectDesc, &uiINTBAR ) )
AssertMsg(0, "Missing INTERFACE\\timebaryellow.sti" );
FilenameForBPP("INTERFACE\\timebaryellow.sti", VObjectDesc.ImageFile);
}
else if (iResolution == 1)
{
FilenameForBPP("INTERFACE\\timebaryellow_800x600.sti", VObjectDesc.ImageFile);
if( !AddVideoObject( &VObjectDesc, &uiINTBAR ) )
AssertMsg(0, "Missing INTERFACE\\timebaryellow_800x600.sti" );
}
else if (iResolution == 2)
{
FilenameForBPP("INTERFACE\\timebaryellow_1024x768.sti", VObjectDesc.ImageFile);
if( !AddVideoObject( &VObjectDesc, &uiINTBAR ) )
AssertMsg(0, "Missing INTERFACE\\timebaryellow_1024x768.sti" );
}
else
{
AssertMsg( 0, "Invalid resolution");
return;
}
if( !AddVideoObject( &VObjectDesc, &uiINTBAR ) )
AssertMsg(0, String( "Missing %s", VObjectDesc.ImageFile) );
// Change dest buffer
SetFontDestBuffer( uiSurface , 0, 0, SCREEN_WIDTH , 20, FALSE );
@@ -3837,13 +3846,12 @@ void RenderAimCubeUI( )
if ( gfInAimCubeUI )
{
// Determine screen location....
GetGridNoScreenPos( gCubeUIData.sGridNo, gCubeUIData.ubLevel, &sScreenX, &sScreenY );
// OK, given height
if ( gCubeUIData.fShowHeight )
{
// Determine screen location....
GetGridNoScreenPos( gCubeUIData.sGridNo, gCubeUIData.ubLevel, &sScreenX, &sScreenY );
// Save background
iBack = RegisterBackgroundRect( BGND_FLAG_SINGLE, NULL, sScreenX, (INT16)(sScreenY - 70 ), (INT16)(sScreenX + 40 ), (INT16)(sScreenY + 50 ) );
if ( iBack != -1 )
+2
View File
@@ -3576,6 +3576,8 @@ INT8 FireBulletGivenTarget( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOA
ddOrigHorizAngle = atan2( dDeltaY, dDeltaX );
ddOrigVerticAngle = atan2( dDeltaZ, (d2DDistance * 2.56f) );
ddAdjustedHorizAngle = ddOrigHorizAngle;
ddAdjustedVerticAngle = ddOrigVerticAngle;
ubShots = 1;
fTracer = FALSE;
+1 -1
View File
@@ -1059,7 +1059,7 @@ void HandleShadingOfLinesForMilitiaControlMenu( void )
BOOLEAN CheckIfRadioIsEquipped( void )
{
SOLDIERTYPE *pSoldier = NULL;
INT8 bSlot;
INT8 bSlot = NO_SLOT;
// do we have a radio ?
//pSoldier = GetSelectedAssignSoldier( FALSE ); //do not use
+4 -1
View File
@@ -3111,7 +3111,7 @@ void RebuildAllSoldierShadeTables( )
void HandlePlayerTeamMemberDeath( SOLDIERTYPE *pSoldier )
{
INT32 cnt;
INT32 iNewSelectedSoldier;
INT32 iNewSelectedSoldier = -1;
SOLDIERTYPE *pTeamSoldier;
BOOLEAN fMissionFailed = TRUE;
INT8 bBuddyIndex;
@@ -8340,6 +8340,9 @@ void DoCreatureTensionQuote( SOLDIERTYPE *pSoldier )
fCanDoQuote = FALSE;
}
break;
default:
AssertMsg(0, "Invalid quote");
return;
}
if ( fCanDoQuote )
+859 -859
View File
File diff suppressed because it is too large Load Diff
+491 -489
View File
File diff suppressed because it is too large Load Diff
+7 -1
View File
@@ -524,7 +524,7 @@ void SortSoldierInitList()
}
BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *curr )
BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *curr, GROUP *pGroup = NULL )
{
UINT8 ubProfile;
SOLDIERCREATE_STRUCT tempDetailedPlacement;
@@ -723,6 +723,12 @@ BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *curr )
{
curr->pSoldier = pSoldier;
curr->ubSoldierID = ubID;
if (pGroup)
{
pSoldier->ubGroupID = pGroup->ubGroupID;
pSoldier->pGroup = pGroup;
}
AddSoldierToSectorNoCalculateDirection( ubID );
if( pSoldier->bActive && pSoldier->bInSector && pSoldier->bTeam == ENEMY_TEAM && !pSoldier->inv[ HANDPOS ].usItem )
+1 -1
View File
@@ -73,7 +73,7 @@ void OutputDebugInfoForTurnBasedNextTileWaiting( SOLDIERTYPE * pSoldier )
if ( (gTacticalStatus.uiFlags & INCOMBAT) && (pSoldier->usPathDataSize > 0) )
{
UINT32 uiLoop;
UINT16 usTemp;
UINT16 usTemp = NOWHERE;
UINT16 usNewGridNo;
usNewGridNo = NewGridNo( pSoldier->sGridNo, DirectionInc( (UINT8)pSoldier->usPathingData[ pSoldier->usPathIndex ] ) );
+1 -1
View File
@@ -121,7 +121,7 @@ void AccumulateBurstLocation( INT16 sGridNo )
void PickBurstLocations( SOLDIERTYPE *pSoldier )
{
UINT8 ubShotsPerBurst;
UINT8 ubShotsPerBurst = 0;
FLOAT dAccululator = 0;
FLOAT dStep = 0;
INT32 cnt;
+2 -1
View File
@@ -46,8 +46,9 @@
RuntimeLibrary="1"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
WarningLevel="4"
DebugInformationFormat="4"
DisableSpecificWarnings="4100"
/>
<Tool
Name="VCManagedResourceCompilerTool"
+1 -1
View File
@@ -3005,7 +3005,7 @@ void StructureHit( INT32 iBullet, UINT16 usWeaponIndex, INT8 bWeaponStatus, UINT
UINT32 uiMissVolume = MIDVOLUME;
BOOLEAN fHitSameStructureAsBefore;
BULLET * pBullet;
SOLDIERTYPE * pAttacker;
SOLDIERTYPE * pAttacker = NULL;
pBullet = GetBulletPtr( iBullet );
+2
View File
@@ -453,6 +453,7 @@ void AddMissileTrail( BULLET *pBullet, FIXEDPT qCurrX, FIXEDPT qCurrY, FIXEDPT q
ConvertGridNoToCenterCellXY( pBullet->sGridNo, &sXPos, &sYPos );
LightSpritePosition( pBullet->pAniTile->lightSprite, (INT16)(sXPos/CELL_X_SIZE), (INT16)(sYPos/CELL_Y_SIZE));
#if 0
if ( pBullet->pFirer->bLevel > 0 ) // if firer on roof then
{
if ( FindBuilding(AniParams.sGridNo) != NULL ) // if this spot is still within the building's grid area
@@ -460,6 +461,7 @@ void AddMissileTrail( BULLET *pBullet, FIXEDPT qCurrX, FIXEDPT qCurrY, FIXEDPT q
LightSpritePower( pBullet->pAniTile->lightSprite, FALSE);
}
}
#endif
return;
}
+1 -1
View File
@@ -5066,7 +5066,7 @@ void ProcessNoise(UINT8 ubNoiseMaker, INT16 sGridNo, INT8 bLevel, UINT8 ubTerrTy
INT8 bCheckTerrain = FALSE;
UINT8 ubSourceTerrType, ubSource;
INT8 bTellPlayer = FALSE, bHeard, bSeen;
UINT8 ubHeardLoudestBy, ubNoiseDir, ubLoudestNoiseDir;
UINT8 ubHeardLoudestBy = NOBODY, ubNoiseDir = 0xff, ubLoudestNoiseDir = 0xff;
#ifdef RECORDOPPLIST