mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
**********************************************************
** Big Maps Projects code (incl. Multiplayer v1.5 ** ********************************************************** - Merged Big Maps Project code from BMP+MP trunk (Revision: 3340) o Complete SVN Revision history: https://81.169.133.124/source/ja2/branches/Wanne/JA2%201.13%20MP - Before THIS merge, I made a branch of the existing 1.13 source o SVN Branch: https://81.169.133.124/source/ja2/branches/JA2_rev.3336/src - Removed old VS 6.0 and VS 2003 project and solutions files, because compilation is broken long time ago - I will add VS 2010 projects and solution file in the next few days git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3341 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+140
-106
@@ -72,11 +72,11 @@ ITEM_POOL_LOCATOR FlashItemSlots[ NUM_ITEM_FLASH_SLOTS ];
|
||||
UINT32 guiNumFlashItemSlots = 0;
|
||||
|
||||
|
||||
LEVELNODE *AddItemGraphicToWorld( INVTYPE *pItem, INT16 sGridNo, UINT8 ubLevel );
|
||||
LEVELNODE *AddItemGraphicToWorld( INVTYPE *pItem, INT32 sGridNo, UINT8 ubLevel );
|
||||
INT8 GetListMouseHotSpot( INT16 sLargestLineWidth, INT8 bNumItemsListed, INT16 sFontX, INT16 sFontY, INT8 bCurStart );
|
||||
void RemoveItemGraphicFromWorld( INVTYPE *pItem, INT16 sGridNo, UINT8 ubLevel, LEVELNODE *pLevelNode );
|
||||
void RemoveItemGraphicFromWorld( INVTYPE *pItem, INT32 sGridNo, UINT8 ubLevel, LEVELNODE *pLevelNode );
|
||||
|
||||
ITEM_POOL * GetItemPoolForIndex( INT16 sGridNo, INT32 iItemIndex, UINT8 ubLevel );
|
||||
ITEM_POOL * GetItemPoolForIndex( INT32 sGridNo, INT32 iItemIndex, UINT8 ubLevel );
|
||||
|
||||
INT32 GetFreeFlashItemSlot(void);
|
||||
void RecountFlashItemSlots(void);
|
||||
@@ -85,7 +85,7 @@ BOOLEAN RemoveFlashItemSlot( ITEM_POOL *pItemPool );
|
||||
|
||||
// Disgusting hacks: have to keep track of these values for accesses in callbacks
|
||||
static SOLDIERTYPE * gpTempSoldier;
|
||||
static INT16 gsTempGridno;
|
||||
static INT32 gsTempGridNo;
|
||||
static INT8 bTempFrequency;
|
||||
|
||||
void BombMessageBoxCallBack( UINT8 ubExitValue );
|
||||
@@ -100,7 +100,7 @@ void CheckForPickedOwnership( void );
|
||||
void BoobyTrapInMapScreenMessageBoxCallBack( UINT8 ubExitValue );
|
||||
|
||||
|
||||
BOOLEAN ContinuePastBoobyTrap( SOLDIERTYPE * pSoldier, INT16 sGridNo, INT8 bLevel, INT32 iItemIndex, BOOLEAN fInStrategic, BOOLEAN *pfSaidQuote );
|
||||
BOOLEAN ContinuePastBoobyTrap( SOLDIERTYPE * pSoldier, INT32 sGridNo, INT8 bLevel, INT32 iItemIndex, BOOLEAN fInStrategic, BOOLEAN *pfSaidQuote );
|
||||
extern BOOLEAN ItemIsCool( OBJECTTYPE * pObj );
|
||||
extern INT8 gbItemPointerSrcSlot;
|
||||
extern void MAPEndItemPointer( );
|
||||
@@ -110,16 +110,16 @@ BOOLEAN ItemPoolOKForPickup( SOLDIERTYPE * pSoldier, ITEM_POOL *pItemPool, INT8
|
||||
|
||||
SOLDIERTYPE * gpBoobyTrapSoldier;
|
||||
ITEM_POOL * gpBoobyTrapItemPool;
|
||||
INT16 gsBoobyTrapGridNo;
|
||||
INT32 gsBoobyTrapGridNo;
|
||||
INT8 gbBoobyTrapLevel;
|
||||
BOOLEAN gfDisarmingBuriedBomb;
|
||||
extern BOOLEAN gfDontChargeAPsToPickup;
|
||||
INT8 gbTrapDifficulty;
|
||||
BOOLEAN gfJustFoundBoobyTrap = FALSE;
|
||||
|
||||
void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT16 sGridNo );
|
||||
void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo );
|
||||
|
||||
BOOLEAN HandleCheckForBadChangeToGetThrough( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pTargetSoldier, INT16 sTargetGridNo , INT8 bLevel )
|
||||
BOOLEAN HandleCheckForBadChangeToGetThrough( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pTargetSoldier, INT32 sTargetGridNo , INT8 bLevel )
|
||||
{
|
||||
BOOLEAN fBadChangeToGetThrough = FALSE;
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("HandleCheckForBadChangeToGetThrough"));
|
||||
@@ -183,15 +183,15 @@ BOOLEAN HandleCheckForBadChangeToGetThrough( SOLDIERTYPE *pSoldier, SOLDIERTYPE
|
||||
|
||||
|
||||
|
||||
INT32 HandleItem( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel, UINT16 usHandItem, BOOLEAN fFromUI )
|
||||
INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHandItem, BOOLEAN fFromUI )
|
||||
{
|
||||
SOLDIERTYPE *pTargetSoldier = NULL;
|
||||
UINT16 usSoldierIndex;
|
||||
INT16 sTargetGridNo;
|
||||
INT32 sTargetGridNo;
|
||||
INT16 sAPCost;
|
||||
INT16 sActionGridNo;
|
||||
INT32 sActionGridNo;
|
||||
UINT8 ubDirection = 0;
|
||||
INT16 sAdjustedGridNo = 0;
|
||||
INT32 sAdjustedGridNo;
|
||||
BOOLEAN fDropBomb = FALSE;
|
||||
BOOLEAN fAddingTurningCost = FALSE;
|
||||
BOOLEAN fAddingRaiseGunCost = FALSE;
|
||||
@@ -216,7 +216,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
|
||||
if ( fFromUI )
|
||||
{
|
||||
INT16 sInteractiveGridNo;
|
||||
INT32 sInteractiveGridNo;
|
||||
|
||||
// ATE: Check if we are targeting an interactive tile, and adjust gridno accordingly...
|
||||
pIntNode = GetCurInteractiveTileGridNoAndStructure( &sInteractiveGridNo, &pStructure );
|
||||
@@ -653,9 +653,9 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
if ( Item[ usHandItem ].usItemClass == IC_PUNCH )
|
||||
{
|
||||
//INT16 sCnt;
|
||||
INT16 sSpot;
|
||||
INT32 sSpot;
|
||||
UINT8 ubGuyThere;
|
||||
INT16 sGotLocation = NOWHERE;
|
||||
INT32 sGotLocation = NOWHERE;
|
||||
BOOLEAN fGotAdjacent = FALSE;
|
||||
|
||||
for ( INT8 sCnt = 0; sCnt < NUM_WORLD_DIRECTIONS; sCnt++ )
|
||||
@@ -681,8 +681,8 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( sGotLocation == NOWHERE )
|
||||
|
||||
if (TileIsOutOfBounds(sGotLocation))
|
||||
{
|
||||
// See if we can get there to punch
|
||||
sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
|
||||
@@ -695,8 +695,8 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
}
|
||||
}
|
||||
|
||||
// Did we get a loaction?
|
||||
if ( sGotLocation != NOWHERE )
|
||||
// Did we get a loaction?
|
||||
if (!TileIsOutOfBounds(sGotLocation))
|
||||
{
|
||||
pSoldier->sTargetGridNo = sGridNo;
|
||||
|
||||
@@ -736,16 +736,16 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
if ( Item[ usHandItem ].usItemClass == IC_MEDKIT )
|
||||
{
|
||||
// ATE: AI CANNOT GO THROUGH HERE!
|
||||
INT16 sMapPos;
|
||||
INT32 usMapPos;
|
||||
BOOLEAN fHadToUseCursorPos = FALSE;
|
||||
|
||||
if (gTacticalStatus.fAutoBandageMode)
|
||||
{
|
||||
sMapPos = sGridNo;
|
||||
usMapPos = sGridNo;
|
||||
}
|
||||
else
|
||||
{
|
||||
GetMouseMapPos( &sMapPos );
|
||||
GetMouseMapPos( &usMapPos );
|
||||
}
|
||||
|
||||
// See if we can get there to stab
|
||||
@@ -753,7 +753,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
if ( sActionGridNo == -1 )
|
||||
{
|
||||
// Try another location...
|
||||
sActionGridNo = FindAdjacentGridEx( pSoldier, sMapPos, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
|
||||
sActionGridNo = FindAdjacentGridEx( pSoldier, usMapPos, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
|
||||
|
||||
if ( sActionGridNo == -1 )
|
||||
{
|
||||
@@ -783,7 +783,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
|
||||
if ( fHadToUseCursorPos )
|
||||
{
|
||||
pSoldier->aiData.sPendingActionData2 = sMapPos;
|
||||
pSoldier->aiData.sPendingActionData2 = usMapPos;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -875,17 +875,17 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
{
|
||||
UINT8 ubMercID;
|
||||
BOOLEAN fVehicle = FALSE;
|
||||
INT16 sVehicleGridNo=-1;
|
||||
INT32 sVehicleGridNo=-1;
|
||||
|
||||
// For repair, check if we are over a vehicle, then get gridnot to edge of that vehicle!
|
||||
if ( IsRepairableStructAtGridNo( sGridNo, &ubMercID ) == 2 )
|
||||
{
|
||||
INT16 sNewGridNo;
|
||||
INT32 sNewGridNo;
|
||||
UINT8 ubDirection;
|
||||
|
||||
sNewGridNo = FindGridNoFromSweetSpotWithStructDataFromSoldier( pSoldier, pSoldier->usUIMovementMode, 5, &ubDirection, 0, MercPtrs[ ubMercID ] );
|
||||
|
||||
if ( sNewGridNo != NOWHERE )
|
||||
|
||||
if (!TileIsOutOfBounds(sNewGridNo))
|
||||
{
|
||||
sGridNo = sNewGridNo;
|
||||
|
||||
@@ -953,17 +953,17 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
if ( Item[usHandItem].gascan )
|
||||
{
|
||||
UINT8 ubMercID;
|
||||
INT16 sVehicleGridNo=-1;
|
||||
INT32 sVehicleGridNo=-1;
|
||||
|
||||
// For repair, check if we are over a vehicle, then get gridnot to edge of that vehicle!
|
||||
if ( IsRefuelableStructAtGridNo( sGridNo, &ubMercID ) )
|
||||
{
|
||||
INT16 sNewGridNo;
|
||||
INT32 sNewGridNo;
|
||||
UINT8 ubDirection;
|
||||
|
||||
sNewGridNo = FindGridNoFromSweetSpotWithStructDataFromSoldier( pSoldier, pSoldier->usUIMovementMode, 5, &ubDirection, 0, MercPtrs[ ubMercID ] );
|
||||
|
||||
if ( sNewGridNo != NOWHERE )
|
||||
|
||||
if (!TileIsOutOfBounds(sNewGridNo))
|
||||
{
|
||||
sGridNo = sNewGridNo;
|
||||
|
||||
@@ -1080,7 +1080,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
LEVELNODE *pIntTile;
|
||||
|
||||
// Get structure info for in tile!
|
||||
pIntTile = GetCurInteractiveTileGridNoAndStructure( (INT16 *)&sGridNo, &pStructure );
|
||||
pIntTile = GetCurInteractiveTileGridNoAndStructure( &sGridNo, &pStructure );
|
||||
|
||||
// We should not have null here if we are given this flag...
|
||||
if ( pIntTile != NULL )
|
||||
@@ -1312,7 +1312,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
// THIS IS IF WE WERE FROM THE UI
|
||||
if ( Item[ usHandItem ].usItemClass == IC_GRENADE || Item[ usHandItem ].usItemClass == IC_LAUNCHER || Item[ usHandItem ].usItemClass == IC_THROWN )
|
||||
{
|
||||
INT16 sCheckGridNo;
|
||||
INT32 sCheckGridNo;
|
||||
|
||||
// Get gridno - either soldier's position or the gridno
|
||||
if ( pTargetSoldier != NULL )
|
||||
@@ -1332,7 +1332,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
ubDirection = (UINT8)GetDirectionFromGridNo( sTargetGridNo, pSoldier );
|
||||
|
||||
// Get new gridno!
|
||||
sCheckGridNo = NewGridNo( (INT16)pSoldier->sGridNo, (UINT16)DirectionInc( ubDirection ) );
|
||||
sCheckGridNo = NewGridNo( pSoldier->sGridNo, (UINT16)DirectionInc( ubDirection ) );
|
||||
|
||||
if ( !OKFallDirection( pSoldier, sCheckGridNo, pSoldier->pathing.bLevel, ubDirection , pSoldier->usAnimState ) )
|
||||
{
|
||||
@@ -1437,7 +1437,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
}
|
||||
|
||||
|
||||
void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||
{
|
||||
// Does this have detonator that needs info?
|
||||
if ( IsDetonatorAttached ( &(pSoldier->inv[ HANDPOS ] ) ) || IsRemoteDetonatorAttached( &(pSoldier->inv[ HANDPOS ] ) ) )
|
||||
@@ -1484,7 +1484,7 @@ void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
}
|
||||
}
|
||||
|
||||
void HandleSoldierUseRemote( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
void HandleSoldierUseRemote( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||
{
|
||||
StartBombMessageBox( pSoldier, sGridNo );
|
||||
}
|
||||
@@ -1507,7 +1507,7 @@ void SoldierHandleDropItem( SOLDIERTYPE *pSoldier )
|
||||
}
|
||||
|
||||
|
||||
void HandleSoldierThrowItem( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
void HandleSoldierThrowItem( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||
{
|
||||
// Determine what to do
|
||||
UINT8 ubDirection;
|
||||
@@ -1598,7 +1598,7 @@ void HandleSoldierThrowItem( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
|
||||
void SoldierGiveItem( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pTargetSoldier, OBJECTTYPE *pObject, INT8 bInvPos )
|
||||
{
|
||||
INT16 sActionGridNo, sAdjustedGridNo;
|
||||
INT32 sActionGridNo, sAdjustedGridNo;
|
||||
UINT8 ubDirection;
|
||||
|
||||
// Remove any previous actions
|
||||
@@ -1654,9 +1654,9 @@ BOOLEAN SoldierDropItem( SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj )
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
void SoldierPickupItem( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT16 sGridNo, INT8 bZLevel )
|
||||
void SoldierPickupItem( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT32 sGridNo, INT8 bZLevel )
|
||||
{
|
||||
INT16 sActionGridNo;
|
||||
INT32 sActionGridNo;
|
||||
|
||||
// Remove any previous actions
|
||||
pSoldier->aiData.ubPendingAction = NO_PENDING_ACTION;
|
||||
@@ -1697,13 +1697,13 @@ void SoldierPickupItem( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT16 sGridNo,
|
||||
else
|
||||
{
|
||||
// DO ANIMATION OF PICKUP NOW!
|
||||
PickPickupAnimation( pSoldier, pSoldier->aiData.uiPendingActionData1, (INT16)( pSoldier->aiData.uiPendingActionData4 ), pSoldier->aiData.bPendingActionData3 );
|
||||
PickPickupAnimation( pSoldier, pSoldier->aiData.uiPendingActionData1, pSoldier->aiData.uiPendingActionData4, pSoldier->aiData.bPendingActionData3 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void HandleAutoPlaceFail( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT16 sGridNo )
|
||||
void HandleAutoPlaceFail( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT32 sGridNo )
|
||||
{
|
||||
if (pSoldier->bTeam == gbPlayerNum)
|
||||
{
|
||||
@@ -1726,7 +1726,7 @@ void HandleAutoPlaceFail( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT16 sGridNo
|
||||
}
|
||||
}
|
||||
|
||||
void SoldierGetItemFromWorld( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT16 sGridNo, INT8 bZLevel, BOOLEAN *pfSelectionList )
|
||||
void SoldierGetItemFromWorld( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT32 sGridNo, INT8 bZLevel, BOOLEAN *pfSelectionList )
|
||||
{
|
||||
ITEM_POOL * pItemPool;
|
||||
ITEM_POOL * pItemPoolToDelete = NULL;
|
||||
@@ -1948,12 +1948,12 @@ void SoldierGetItemFromWorld( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT16 sGr
|
||||
}
|
||||
|
||||
gpTempSoldier = pSoldier;
|
||||
gsTempGridno = sGridNo;
|
||||
gsTempGridNo = sGridNo;
|
||||
SetCustomizableTimerCallbackAndDelay( 1000, CheckForPickedOwnership, TRUE );
|
||||
}
|
||||
|
||||
|
||||
void HandleSoldierPickupItem( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT16 sGridNo, INT8 bZLevel )
|
||||
void HandleSoldierPickupItem( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT32 sGridNo, INT8 bZLevel )
|
||||
{
|
||||
ITEM_POOL *pItemPool;
|
||||
UINT16 usNum;
|
||||
@@ -1973,7 +1973,8 @@ void HandleSoldierPickupItem( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT16 sGr
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_PLAYER_MINE_PRESENT)
|
||||
if (gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_PLAYER_MINE_PRESENT ||
|
||||
(is_networked && is_client && FindWorldItemForBombInGridNo( sGridNo, pSoldier->pathing.bLevel ) != -1)) // 20091029 - OJW - Disarm player planted bombs!
|
||||
{
|
||||
// have the computer ask us if we want to proceed
|
||||
|
||||
@@ -2079,7 +2080,7 @@ void HandleSoldierPickupItem( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT16 sGr
|
||||
}
|
||||
|
||||
|
||||
LEVELNODE *AddItemGraphicToWorld( INVTYPE *pItem, INT16 sGridNo, UINT8 ubLevel )
|
||||
LEVELNODE *AddItemGraphicToWorld( INVTYPE *pItem, INT32 sGridNo, UINT8 ubLevel )
|
||||
{
|
||||
UINT16 usTileIndex;
|
||||
LEVELNODE *pNode;
|
||||
@@ -2112,7 +2113,7 @@ LEVELNODE *AddItemGraphicToWorld( INVTYPE *pItem, INT16 sGridNo, UINT8 ubLevel )
|
||||
}
|
||||
|
||||
|
||||
void RemoveItemGraphicFromWorld( INVTYPE *pItem, INT16 sGridNo, UINT8 ubLevel, LEVELNODE *pLevelNode )
|
||||
void RemoveItemGraphicFromWorld( INVTYPE *pItem, INT32 sGridNo, UINT8 ubLevel, LEVELNODE *pLevelNode )
|
||||
{
|
||||
LEVELNODE *pNode;
|
||||
|
||||
@@ -2159,31 +2160,31 @@ void RemoveItemGraphicFromWorld( INVTYPE *pItem, INT16 sGridNo, UINT8 ubLevel, L
|
||||
}
|
||||
|
||||
// INVENTORY POOL STUFF
|
||||
OBJECTTYPE* AddItemToPool( INT16 sGridNo, OBJECTTYPE *pObject, INT8 bVisible, UINT8 ubLevel, UINT16 usFlags, INT8 bRenderZHeightAboveLevel, INT8 soldierID )
|
||||
OBJECTTYPE* AddItemToPool( INT32 sGridNo, OBJECTTYPE *pObject, INT8 bVisible, UINT8 ubLevel, UINT16 usFlags, INT8 bRenderZHeightAboveLevel, INT8 soldierID )
|
||||
{
|
||||
return InternalAddItemToPool( &sGridNo, pObject, bVisible, ubLevel, usFlags, bRenderZHeightAboveLevel, soldierID, NULL );
|
||||
}
|
||||
|
||||
OBJECTTYPE * AddItemToPoolAndGetIndex( INT16 sGridNo, OBJECTTYPE *pObject, INT8 bVisible, UINT8 ubLevel, UINT16 usFlags, INT8 bRenderZHeightAboveLevel, INT8 soldierID, INT32 * piItemIndex )
|
||||
OBJECTTYPE * AddItemToPoolAndGetIndex( INT32 sGridNo, OBJECTTYPE *pObject, INT8 bVisible, UINT8 ubLevel, UINT16 usFlags, INT8 bRenderZHeightAboveLevel, INT8 soldierID, INT32 * piItemIndex )
|
||||
{
|
||||
return( InternalAddItemToPool( &sGridNo, pObject, bVisible, ubLevel, usFlags, bRenderZHeightAboveLevel, soldierID, piItemIndex ) );
|
||||
}
|
||||
|
||||
OBJECTTYPE* InternalAddItemToPool( INT16 *psGridNo, OBJECTTYPE *pObject, INT8 bVisible, UINT8 ubLevel, UINT16 usFlags, INT8 bRenderZHeightAboveLevel, INT8 soldierID, INT32 * piItemIndex )
|
||||
OBJECTTYPE* InternalAddItemToPool( INT32 *psGridNo, OBJECTTYPE *pObject, INT8 bVisible, UINT8 ubLevel, UINT16 usFlags, INT8 bRenderZHeightAboveLevel, INT8 soldierID, INT32 * piItemIndex )
|
||||
{
|
||||
ITEM_POOL *pItemPool;
|
||||
ITEM_POOL *pItemPoolTemp;
|
||||
INT32 iWorldItem = 0;
|
||||
STRUCTURE *pStructure, *pBase;
|
||||
INT16 sDesiredLevel;
|
||||
INT16 sNewGridNo = *psGridNo;
|
||||
INT32 sNewGridNo = *psGridNo;
|
||||
LEVELNODE *pNode;
|
||||
BOOLEAN fForceOnGround = FALSE;
|
||||
BOOLEAN fObjectInOpenable = FALSE;
|
||||
INT8 bTerrainID;
|
||||
|
||||
// ATE: Check if the gridno is OK
|
||||
if ( (*psGridNo) == NOWHERE )
|
||||
// ATE: Check if the gridno is OK
|
||||
if (TileIsOutOfBounds((*psGridNo)))
|
||||
{
|
||||
// Display warning.....
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_BETAVERSION, L"Error: Item %d was given invalid grid location %d for item pool. Please Report.", pObject->usItem, (*psGridNo) );
|
||||
@@ -2464,7 +2465,7 @@ OBJECTTYPE* InternalAddItemToPool( INT16 *psGridNo, OBJECTTYPE *pObject, INT8 bV
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN ItemExistsAtLocation( INT16 sGridNo, INT32 iItemIndex, UINT8 ubLevel )
|
||||
BOOLEAN ItemExistsAtLocation( INT32 sGridNo, INT32 iItemIndex, UINT8 ubLevel )
|
||||
{
|
||||
ITEM_POOL *pItemPool;
|
||||
ITEM_POOL *pItemPoolTemp;
|
||||
@@ -2488,7 +2489,7 @@ BOOLEAN ItemExistsAtLocation( INT16 sGridNo, INT32 iItemIndex, UINT8 ubLevel )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
BOOLEAN ItemTypeExistsAtLocation( INT16 sGridNo, UINT16 usItem, UINT8 ubLevel, INT32 * piItemIndex )
|
||||
BOOLEAN ItemTypeExistsAtLocation( INT32 sGridNo, UINT16 usItem, UINT8 ubLevel, INT32 * piItemIndex )
|
||||
{
|
||||
ITEM_POOL *pItemPool;
|
||||
ITEM_POOL *pItemPoolTemp;
|
||||
@@ -2516,7 +2517,7 @@ BOOLEAN ItemTypeExistsAtLocation( INT16 sGridNo, UINT16 usItem, UINT8 ubLevel, I
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
BOOLEAN MarblesExistAtLocation( INT16 sGridNo, UINT8 ubLevel, INT32 * piItemIndex )
|
||||
BOOLEAN MarblesExistAtLocation( INT32 sGridNo, UINT8 ubLevel, INT32 * piItemIndex )
|
||||
{
|
||||
ITEM_POOL *pItemPool;
|
||||
ITEM_POOL *pItemPoolTemp;
|
||||
@@ -2545,7 +2546,7 @@ BOOLEAN MarblesExistAtLocation( INT16 sGridNo, UINT8 ubLevel, INT32 * piItemInde
|
||||
}
|
||||
|
||||
|
||||
INT32 GetItemOfClassTypeInPool( INT16 sGridNo, UINT32 uiItemClass, UINT8 ubLevel )
|
||||
INT32 GetItemOfClassTypeInPool( INT32 sGridNo, UINT32 uiItemClass, UINT8 ubLevel )
|
||||
{
|
||||
ITEM_POOL *pItemPool;
|
||||
ITEM_POOL *pItemPoolTemp;
|
||||
@@ -2569,7 +2570,7 @@ INT32 GetItemOfClassTypeInPool( INT16 sGridNo, UINT32 uiItemClass, UINT8 ubLevel
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
ITEM_POOL * GetItemPoolForIndex( INT16 sGridNo, INT32 iItemIndex, UINT8 ubLevel )
|
||||
ITEM_POOL * GetItemPoolForIndex( INT32 sGridNo, INT32 iItemIndex, UINT8 ubLevel )
|
||||
{
|
||||
ITEM_POOL *pItemPool;
|
||||
ITEM_POOL *pItemPoolTemp;
|
||||
@@ -2628,7 +2629,7 @@ BOOLEAN DoesItemPoolContainAllHiddenItems( ITEM_POOL *pItemPool )
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN LookForHiddenItems( INT16 sGridNo, INT8 ubLevel, BOOLEAN fSetLocator, INT8 bZLevel )
|
||||
BOOLEAN LookForHiddenItems( INT32 sGridNo, INT8 ubLevel, BOOLEAN fSetLocator, INT8 bZLevel )
|
||||
{
|
||||
ITEM_POOL *pItemPool = NULL;
|
||||
ITEM_POOL *pHeadItemPool = NULL;
|
||||
@@ -2662,7 +2663,7 @@ BOOLEAN LookForHiddenItems( INT16 sGridNo, INT8 ubLevel, BOOLEAN fSetLocator, IN
|
||||
}
|
||||
|
||||
|
||||
INT8 GetZLevelOfItemPoolGivenStructure( INT16 sGridNo, UINT8 ubLevel, STRUCTURE *pStructure )
|
||||
INT8 GetZLevelOfItemPoolGivenStructure( INT32 sGridNo, UINT8 ubLevel, STRUCTURE *pStructure )
|
||||
{
|
||||
ITEM_POOL *pItemPool;
|
||||
|
||||
@@ -2695,7 +2696,7 @@ INT8 GetLargestZLevelOfItemPool( ITEM_POOL *pItemPool )
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
void RemoveItemPool( INT16 sGridNo, UINT8 ubLevel )
|
||||
void RemoveItemPool( INT32 sGridNo, UINT8 ubLevel )
|
||||
{
|
||||
ITEM_POOL *pItemPool;
|
||||
|
||||
@@ -2706,7 +2707,7 @@ void RemoveItemPool( INT16 sGridNo, UINT8 ubLevel )
|
||||
}
|
||||
}
|
||||
|
||||
void RemoveAllUnburiedItems( INT16 sGridNo, UINT8 ubLevel )
|
||||
void RemoveAllUnburiedItems( INT32 sGridNo, UINT8 ubLevel )
|
||||
{
|
||||
ITEM_POOL *pItemPool;
|
||||
|
||||
@@ -2729,7 +2730,7 @@ void RemoveAllUnburiedItems( INT16 sGridNo, UINT8 ubLevel )
|
||||
}
|
||||
|
||||
|
||||
void LoopLevelNodeForShowThroughFlag( LEVELNODE *pNode, INT16 sGridNo, UINT8 ubLevel )
|
||||
void LoopLevelNodeForShowThroughFlag( LEVELNODE *pNode, INT32 sGridNo, UINT8 ubLevel )
|
||||
{
|
||||
while ( pNode != NULL )
|
||||
{
|
||||
@@ -2758,7 +2759,7 @@ void LoopLevelNodeForShowThroughFlag( LEVELNODE *pNode, INT16 sGridNo, UINT8 ubL
|
||||
}
|
||||
}
|
||||
|
||||
void HandleItemObscuredFlag( INT16 sGridNo, UINT8 ubLevel )
|
||||
void HandleItemObscuredFlag( INT32 sGridNo, UINT8 ubLevel )
|
||||
{
|
||||
LEVELNODE *pNode;
|
||||
|
||||
@@ -2950,7 +2951,7 @@ void AdjustItemPoolVisibility( ITEM_POOL *pItemPool )
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN RemoveItemFromPool( INT16 sGridNo, INT32 iItemIndex, UINT8 ubLevel )
|
||||
BOOLEAN RemoveItemFromPool( INT32 sGridNo, INT32 iItemIndex, UINT8 ubLevel )
|
||||
{
|
||||
ITEM_POOL *pItemPool;
|
||||
ITEM_POOL *pItemPoolTemp;
|
||||
@@ -3073,7 +3074,7 @@ BOOLEAN RemoveItemFromPool( INT16 sGridNo, INT32 iItemIndex, UINT8 ubLevel )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
BOOLEAN MoveItemPools( INT16 sStartPos, INT16 sEndPos, INT8 bStartLevel, INT8 bEndLevel )
|
||||
BOOLEAN MoveItemPools( INT32 sStartPos, INT32 sEndPos, INT8 bStartLevel, INT8 bEndLevel )
|
||||
{
|
||||
// note, only works between locations on the ground
|
||||
ITEM_POOL *pItemPool;
|
||||
@@ -3090,17 +3091,17 @@ BOOLEAN MoveItemPools( INT16 sStartPos, INT16 sEndPos, INT8 bStartLevel, INT8 bE
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
BOOLEAN GetItemPool( INT16 sMapPos, ITEM_POOL **ppItemPool, UINT8 ubLevel )
|
||||
BOOLEAN GetItemPool( INT32 usMapPos, ITEM_POOL **ppItemPool, UINT8 ubLevel )
|
||||
{
|
||||
LEVELNODE *pObject;
|
||||
|
||||
if ( ubLevel == 0 )
|
||||
{
|
||||
pObject = gpWorldLevelData[ sMapPos ].pStructHead;
|
||||
pObject = gpWorldLevelData[ usMapPos ].pStructHead;
|
||||
}
|
||||
else
|
||||
{
|
||||
pObject = gpWorldLevelData[ sMapPos ].pOnRoofHead;
|
||||
pObject = gpWorldLevelData[ usMapPos ].pOnRoofHead;
|
||||
}
|
||||
|
||||
(*ppItemPool) = NULL;
|
||||
@@ -3125,7 +3126,7 @@ BOOLEAN GetItemPool( INT16 sMapPos, ITEM_POOL **ppItemPool, UINT8 ubLevel )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
BOOLEAN GetItemPoolFromGround( INT16 sMapPos, ITEM_POOL **ppItemPool )
|
||||
BOOLEAN GetItemPoolFromGround( INT32 sMapPos, ITEM_POOL **ppItemPool )
|
||||
{
|
||||
//if we know the level, we can avoid an if, and this function is called alot
|
||||
LEVELNODE *pObject = gpWorldLevelData[ sMapPos ].pStructHead;
|
||||
@@ -3291,7 +3292,7 @@ BOOLEAN ItemPoolOKForPickup( SOLDIERTYPE * pSoldier, ITEM_POOL *pItemPool, INT8
|
||||
extern void HandleAnyMercInSquadHasCompatibleStuff( UINT8 ubSquad, OBJECTTYPE *pObject, BOOLEAN fReset );
|
||||
|
||||
|
||||
BOOLEAN DrawItemPoolList( ITEM_POOL *pItemPool, INT16 sGridNo, UINT8 bCommand, INT8 bZLevel, INT16 sXPos, INT16 sYPos )
|
||||
BOOLEAN DrawItemPoolList( ITEM_POOL *pItemPool, INT32 sGridNo, UINT8 bCommand, INT8 bZLevel, INT16 sXPos, INT16 sYPos )
|
||||
{
|
||||
INT16 sY;
|
||||
INVTYPE *pItem;
|
||||
@@ -3895,7 +3896,7 @@ BOOLEAN VerifyGiveItem( SOLDIERTYPE *pSoldier, SOLDIERTYPE **ppTargetSoldier )
|
||||
UINT16 usSoldierIndex;
|
||||
OBJECTTYPE *pObject;
|
||||
|
||||
INT16 sGridNo;
|
||||
INT32 sGridNo;
|
||||
UINT8 ubDirection;
|
||||
UINT8 ubTargetMercID;
|
||||
|
||||
@@ -3960,7 +3961,7 @@ void SoldierGiveItemFromAnimation( SOLDIERTYPE *pSoldier )
|
||||
INT8 bInvPos;
|
||||
UINT8 ubProfile;
|
||||
|
||||
INT16 sGridNo;
|
||||
INT32 sGridNo;
|
||||
UINT8 ubDirection;
|
||||
UINT8 ubTargetMercID;
|
||||
UINT16 usItemNum;
|
||||
@@ -4149,14 +4150,14 @@ void SoldierGiveItemFromAnimation( SOLDIERTYPE *pSoldier )
|
||||
|
||||
|
||||
|
||||
INT16 AdjustGridNoForItemPlacement( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
INT32 AdjustGridNoForItemPlacement( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||
{
|
||||
STRUCTURE *pStructure;
|
||||
INT16 sDesiredLevel;
|
||||
INT16 sActionGridNo;
|
||||
INT32 sActionGridNo;
|
||||
BOOLEAN fStructFound = FALSE;
|
||||
UINT8 ubDirection;
|
||||
INT16 sAdjustedGridNo;
|
||||
INT32 sAdjustedGridNo;
|
||||
UINT8 ubTargetID;
|
||||
|
||||
|
||||
@@ -4167,7 +4168,7 @@ INT16 AdjustGridNoForItemPlacement( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
{
|
||||
// Something is here, check obstruction in future
|
||||
sDesiredLevel = pSoldier->pathing.bLevel ? STRUCTURE_ON_ROOF : STRUCTURE_ON_GROUND;
|
||||
pStructure = FindStructure( (INT16)sGridNo, STRUCTURE_BLOCKSMOVES );
|
||||
pStructure = FindStructure( sGridNo, STRUCTURE_BLOCKSMOVES );
|
||||
while( pStructure )
|
||||
{
|
||||
if( !(pStructure->fFlags & STRUCTURE_PASSABLE) && pStructure->sCubeOffset == sDesiredLevel )
|
||||
@@ -4201,12 +4202,12 @@ INT16 AdjustGridNoForItemPlacement( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
}
|
||||
|
||||
|
||||
void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT16 sGridNo )
|
||||
void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo )
|
||||
{
|
||||
UINT8 ubRoom;
|
||||
|
||||
gpTempSoldier = pSoldier;
|
||||
gsTempGridno = sGridNo;
|
||||
gsTempGridNo = sGridNo;
|
||||
if (Item[ pSoldier->inv[HANDPOS].usItem].remotetrigger )
|
||||
{
|
||||
DoMessageBox( MSG_BOX_BASIC_SMALL_BUTTONS, TacticalStr[ CHOOSE_BOMB_FREQUENCY_STR ], GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_FOUR_NUMBERED_BUTTONS, BombMessageBoxCallBack, NULL );
|
||||
@@ -4319,7 +4320,7 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
|
||||
// so we add 2 to all owner IDs passed through here and subtract 2 later
|
||||
if (gpTempSoldier->inv[HANDPOS].MoveThisObjectTo(gTempObject, 1) == 0) {
|
||||
gTempObject[0]->data.misc.ubBombOwner = gpTempSoldier->ubID + 2;
|
||||
AddItemToPool( gsTempGridno, &gTempObject, 1, gpTempSoldier->pathing.bLevel, WORLD_ITEM_ARMED_BOMB, 0 );
|
||||
AddItemToPool( gsTempGridNo, &gTempObject, 1, gpTempSoldier->pathing.bLevel, WORLD_ITEM_ARMED_BOMB, 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4425,7 +4426,7 @@ void SetOffBoobyTrap( ITEM_POOL * pItemPool )
|
||||
|
||||
}
|
||||
|
||||
BOOLEAN ContinuePastBoobyTrap( SOLDIERTYPE * pSoldier, INT16 sGridNo, INT8 bLevel, INT32 iItemIndex, BOOLEAN fInStrategic, BOOLEAN *pfSaidQuote )
|
||||
BOOLEAN ContinuePastBoobyTrap( SOLDIERTYPE * pSoldier, INT32 sGridNo, INT8 bLevel, INT32 iItemIndex, BOOLEAN fInStrategic, BOOLEAN *pfSaidQuote )
|
||||
{
|
||||
BOOLEAN fBoobyTrapKnowledge;
|
||||
INT8 bTrapDifficulty, bTrapDetectLevel;
|
||||
@@ -4615,6 +4616,27 @@ void BoobyTrapMessageBoxCallBack( UINT8 ubExitValue )
|
||||
{
|
||||
// switch action item to the real item type
|
||||
CreateItem( gTempObject[0]->data.misc.usBombItem, gTempObject[0]->data.misc.bBombStatus, &gTempObject );
|
||||
|
||||
if (is_networked && is_client)
|
||||
{
|
||||
OBJECTTYPE TempAttachment;
|
||||
// attach whatever trigger the bomb originally had
|
||||
if (gWorldItems[ gpBoobyTrapItemPool->iItemIndex ].object[0]->data.misc.bDetonatorType == BOMB_REMOTE)
|
||||
{
|
||||
// attack a remote deonator, but they will need a trigger to use it :)
|
||||
CreateItem( REMDETONATOR, gTempObject[0]->data.misc.bBombStatus, &TempAttachment );
|
||||
}
|
||||
else
|
||||
{
|
||||
// always just give a timed detonator so they can use it
|
||||
CreateItem( DETONATOR, gTempObject[0]->data.misc.bBombStatus, &TempAttachment );
|
||||
}
|
||||
|
||||
if (ValidAttachment( TempAttachment.usItem , gTempObject.usItem ))
|
||||
{
|
||||
gTempObject.AttachObject(NULL, &TempAttachment, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// remove any blue flag graphic
|
||||
@@ -4629,6 +4651,9 @@ void BoobyTrapMessageBoxCallBack( UINT8 ubExitValue )
|
||||
// place it in the guy's inventory/cursor
|
||||
if ( AutoPlaceObject( gpBoobyTrapSoldier, &gTempObject, TRUE ) )
|
||||
{
|
||||
// OJW - 20091029 - disarm explosives
|
||||
if (is_networked && is_client)
|
||||
send_disarm_explosive( gsBoobyTrapGridNo , gpBoobyTrapItemPool->iItemIndex , gpBoobyTrapSoldier->ubID );
|
||||
// remove it from the ground
|
||||
RemoveItemFromPool( gsBoobyTrapGridNo, gpBoobyTrapItemPool->iItemIndex, gbBoobyTrapLevel );
|
||||
}
|
||||
@@ -4647,6 +4672,11 @@ void BoobyTrapMessageBoxCallBack( UINT8 ubExitValue )
|
||||
// ATE; If we failed to add to inventory, put failed one in our cursor...
|
||||
gfDontChargeAPsToPickup = TRUE;
|
||||
HandleAutoPlaceFail( gpBoobyTrapSoldier, gpBoobyTrapItemPool->iItemIndex, gsBoobyTrapGridNo );
|
||||
|
||||
// OJW - 20091029 - disarm explosives
|
||||
if (is_networked && is_client)
|
||||
send_disarm_explosive( gsBoobyTrapGridNo , gpBoobyTrapItemPool->iItemIndex , gpBoobyTrapSoldier->ubID );
|
||||
|
||||
RemoveItemFromPool( gsBoobyTrapGridNo, gpBoobyTrapItemPool->iItemIndex, gbBoobyTrapLevel );
|
||||
}
|
||||
else
|
||||
@@ -4658,6 +4688,10 @@ void BoobyTrapMessageBoxCallBack( UINT8 ubExitValue )
|
||||
gpItemPointer = new OBJECTTYPE;
|
||||
gTempObject.MoveThisObjectTo(*gpItemPointer,-1,gpBoobyTrapSoldier,NUM_INV_SLOTS,MAX_OBJECTS_PER_SLOT);
|
||||
}
|
||||
// OJW - 20091029 - disarm explosives
|
||||
if (is_networked && is_client)
|
||||
send_disarm_explosive( gsBoobyTrapGridNo , gpBoobyTrapItemPool->iItemIndex , gpBoobyTrapSoldier->ubID );
|
||||
|
||||
// remove it from the ground
|
||||
RemoveItemFromPool( gsBoobyTrapGridNo, gpBoobyTrapItemPool->iItemIndex, gbBoobyTrapLevel );
|
||||
}
|
||||
@@ -4794,9 +4828,9 @@ void SwitchMessageBoxCallBack( UINT8 ubExitValue )
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN NearbyGroundSeemsWrong( SOLDIERTYPE * pSoldier, INT16 sGridNo, BOOLEAN fCheckAroundGridno, INT16 * psProblemGridNo )
|
||||
BOOLEAN NearbyGroundSeemsWrong( SOLDIERTYPE * pSoldier, INT32 sGridNo, BOOLEAN fCheckAroundGridNo, INT32 * psProblemGridNo )
|
||||
{
|
||||
INT16 sNextGridNo;
|
||||
INT32 sNextGridNo;
|
||||
// BOOLEAN fWorthChecking = FALSE, fProblemExists = FALSE, fDetectedProblem = FALSE;
|
||||
UINT8 ubDetectLevel, ubDirection;
|
||||
MAP_ELEMENT * pMapElement;
|
||||
@@ -4851,7 +4885,7 @@ BOOLEAN NearbyGroundSeemsWrong( SOLDIERTYPE * pSoldier, INT16 sGridNo, BOOLEAN f
|
||||
// check every tile around gridno for the presence of "nasty stuff"
|
||||
for (ubDirection = 0; ubDirection < 8; ubDirection++)
|
||||
{
|
||||
if ( fCheckAroundGridno )
|
||||
if ( fCheckAroundGridNo )
|
||||
{
|
||||
// get the gridno of the next spot adjacent to lastGridno in that direction
|
||||
sNextGridNo = NewGridNo( sGridNo, (INT16) DirectionInc( (UINT8) ubDirection ) );
|
||||
@@ -5018,7 +5052,7 @@ void RemoveBlueFlagDialogueCallBack( UINT8 ubExitValue )
|
||||
}
|
||||
}
|
||||
|
||||
void AddBlueFlag( INT16 sGridNo ,INT8 bLevel )
|
||||
void AddBlueFlag( INT32 sGridNo ,INT8 bLevel )
|
||||
{
|
||||
LEVELNODE *pNode;
|
||||
|
||||
@@ -5037,7 +5071,7 @@ void AddBlueFlag( INT16 sGridNo ,INT8 bLevel )
|
||||
SetRenderFlags(RENDER_FLAG_FULL);
|
||||
}
|
||||
|
||||
void RemoveBlueFlag( INT16 sGridNo, INT8 bLevel )
|
||||
void RemoveBlueFlag( INT32 sGridNo, INT8 bLevel )
|
||||
{
|
||||
ApplyMapChangesToMapTempFile( TRUE );
|
||||
gpWorldLevelData[sGridNo].uiFlags &= ~(MAPELEMENT_PLAYER_MINE_PRESENT);
|
||||
@@ -5114,7 +5148,7 @@ void CheckForPickedOwnership( void )
|
||||
UINT8 ubLoop;
|
||||
|
||||
// LOOP THROUGH LIST TO FIND NODE WE WANT
|
||||
GetItemPool( gsTempGridno, &pItemPool, gpTempSoldier->pathing.bLevel );
|
||||
GetItemPool( gsTempGridNo, &pItemPool, gpTempSoldier->pathing.bLevel );
|
||||
|
||||
while( pItemPool )
|
||||
{
|
||||
@@ -5155,7 +5189,7 @@ void CheckForPickedOwnership( void )
|
||||
|
||||
|
||||
|
||||
void LoopLevelNodeForItemGlowFlag( LEVELNODE *pNode, INT16 sGridNo, UINT8 ubLevel, BOOLEAN fOn )
|
||||
void LoopLevelNodeForItemGlowFlag( LEVELNODE *pNode, INT32 sGridNo, UINT8 ubLevel, BOOLEAN fOn )
|
||||
{
|
||||
while ( pNode != NULL )
|
||||
{
|
||||
@@ -5175,7 +5209,7 @@ void LoopLevelNodeForItemGlowFlag( LEVELNODE *pNode, INT16 sGridNo, UINT8 ubLeve
|
||||
}
|
||||
|
||||
|
||||
void HandleItemGlowFlag( INT16 sGridNo, UINT8 ubLevel, BOOLEAN fOn )
|
||||
void HandleItemGlowFlag( INT32 sGridNo, UINT8 ubLevel, BOOLEAN fOn )
|
||||
{
|
||||
LEVELNODE *pNode;
|
||||
|
||||
@@ -5193,12 +5227,12 @@ void HandleItemGlowFlag( INT16 sGridNo, UINT8 ubLevel, BOOLEAN fOn )
|
||||
|
||||
void ToggleItemGlow( BOOLEAN fOn )
|
||||
{
|
||||
UINT32 cnt;
|
||||
INT32 cnt;
|
||||
|
||||
for ( cnt = 0; cnt < WORLD_MAX; cnt++ )
|
||||
{
|
||||
HandleItemGlowFlag( ( INT16 )cnt, 0, fOn );
|
||||
HandleItemGlowFlag( ( INT16 )cnt, 1, fOn );
|
||||
HandleItemGlowFlag( cnt, 0, fOn );
|
||||
HandleItemGlowFlag( cnt, 1, fOn );
|
||||
}
|
||||
|
||||
if ( !fOn )
|
||||
@@ -5273,12 +5307,12 @@ BOOLEAN ContinuePastBoobyTrapInMapScreen( OBJECTTYPE *pObject, SOLDIERTYPE *pSol
|
||||
// Well, clears all item pools
|
||||
void ClearAllItemPools( )
|
||||
{
|
||||
UINT32 cnt;
|
||||
INT32 cnt;
|
||||
|
||||
for ( cnt = 0; cnt < WORLD_MAX; cnt++ )
|
||||
{
|
||||
RemoveItemPool( (INT16)cnt, 0 );
|
||||
RemoveItemPool( (INT16)cnt, 1 );
|
||||
RemoveItemPool( cnt, 0 );
|
||||
RemoveItemPool( cnt, 1 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5292,14 +5326,14 @@ void RefreshItemPools( WORLDITEM * pItemList, INT32 iNumberOfItems )
|
||||
}
|
||||
|
||||
|
||||
INT16 FindNearestAvailableGridNoForItem( INT16 sSweetGridNo, INT8 ubRadius )
|
||||
INT32 FindNearestAvailableGridNoForItem( INT32 sSweetGridNo, INT8 ubRadius )
|
||||
{
|
||||
INT16 sTop, sBottom;
|
||||
INT16 sLeft, sRight;
|
||||
INT16 cnt1, cnt2, cnt3;
|
||||
INT16 sGridNo;
|
||||
INT32 sTop, sBottom;
|
||||
INT32 sLeft, sRight;
|
||||
INT32 cnt1, cnt2, cnt3;
|
||||
INT32 sGridNo;
|
||||
INT32 uiRange, uiLowestRange = 999999;
|
||||
INT16 sLowestGridNo=0;
|
||||
INT32 sLowestGridNo=0;
|
||||
INT32 leftmost;
|
||||
BOOLEAN fFound = FALSE;
|
||||
SOLDIERTYPE soldier;
|
||||
@@ -5341,7 +5375,7 @@ INT16 FindNearestAvailableGridNoForItem( INT16 sSweetGridNo, INT8 ubRadius )
|
||||
|
||||
//Now, find out which of these gridnos are reachable
|
||||
//(use the fake soldier and the pathing settings)
|
||||
FindBestPath( &soldier, NOWHERE, 0, WALKING, COPYREACHABLE, 0 );
|
||||
FindBestPath( &soldier, GRIDSIZE, 0, WALKING, COPYREACHABLE, 0 );//dnl ch50 071009
|
||||
|
||||
uiLowestRange = 999999;
|
||||
|
||||
@@ -5550,7 +5584,7 @@ UINT8 StealItems(SOLDIERTYPE* pSoldier,SOLDIERTYPE* pOpponent, UINT8* ubIndexRet
|
||||
* jackaians: function copied from SoldierGetItemFromWorld
|
||||
* check user's choices and try to place them in his slots
|
||||
*/
|
||||
void SoldierStealItemFromSoldier( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent,ITEM_POOL *pItemPool, INT32 iItemIndex, INT16 sGridNo, INT8 bZLevel, BOOLEAN *pfSelectionList )
|
||||
void SoldierStealItemFromSoldier( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent,ITEM_POOL *pItemPool, INT32 iItemIndex, INT32 sGridNo, INT8 bZLevel, BOOLEAN *pfSelectionList )
|
||||
{
|
||||
ITEM_POOL *pTempItemPool;
|
||||
INT32 cnt = 0;
|
||||
@@ -5616,6 +5650,6 @@ void SoldierStealItemFromSoldier( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent,
|
||||
pSoldier->DoMercBattleSound( BATTLE_SOUND_GOTIT );
|
||||
}
|
||||
gpTempSoldier = pSoldier;
|
||||
gsTempGridno = sGridNo;
|
||||
gsTempGridNo = sGridNo;
|
||||
SetCustomizableTimerCallbackAndDelay( 1000, CheckForPickedOwnership, TRUE );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user