mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
If a container is destroyed by gunfire or vehicle collision, don't destroy the contents, reveal them instead.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9087 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -3500,6 +3500,28 @@ void RemoveAllUnburiedItems( INT32 sGridNo, UINT8 ubLevel )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RevealAllUnburiedItems( INT32 sGridNo, UINT8 ubLevel )
|
||||||
|
{
|
||||||
|
ITEM_POOL *pItemPool;
|
||||||
|
|
||||||
|
// Check for and existing pool on the object layer
|
||||||
|
GetItemPool( sGridNo, &pItemPool, ubLevel );
|
||||||
|
|
||||||
|
while ( pItemPool )
|
||||||
|
{
|
||||||
|
if ( gWorldItems[pItemPool->iItemIndex].bVisible != BURIED )
|
||||||
|
{
|
||||||
|
gWorldItems[pItemPool->iItemIndex].bVisible = VISIBLE;
|
||||||
|
gWorldItems[pItemPool->iItemIndex].bRenderZHeightAboveLevel = 0;
|
||||||
|
gWorldItems[pItemPool->iItemIndex].ubNonExistChance = 0;
|
||||||
|
gWorldItems[pItemPool->iItemIndex].usFlags &= ( ~WORLD_ITEM_DONTRENDER );
|
||||||
|
}
|
||||||
|
|
||||||
|
pItemPool = pItemPool->pNext;
|
||||||
|
}
|
||||||
|
|
||||||
|
NotifySoldiersToLookforItems();
|
||||||
|
}
|
||||||
|
|
||||||
void LoopLevelNodeForShowThroughFlag( LEVELNODE *pNode, INT32 sGridNo, UINT8 ubLevel )
|
void LoopLevelNodeForShowThroughFlag( LEVELNODE *pNode, INT32 sGridNo, UINT8 ubLevel )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ void RemoveItemPool( INT32 sGridNo, UINT8 ubLevel );
|
|||||||
void RenderTopmostFlashingItems( );
|
void RenderTopmostFlashingItems( );
|
||||||
|
|
||||||
void RemoveAllUnburiedItems( INT32 sGridNo, UINT8 ubLevel );
|
void RemoveAllUnburiedItems( INT32 sGridNo, UINT8 ubLevel );
|
||||||
|
void RevealAllUnburiedItems( INT32 sGridNo, UINT8 ubLevel );
|
||||||
|
|
||||||
BOOLEAN DoesItemPoolContainAnyHiddenItems( ITEM_POOL *pItemPool );
|
BOOLEAN DoesItemPoolContainAnyHiddenItems( ITEM_POOL *pItemPool );
|
||||||
BOOLEAN DoesItemPoolContainAllHiddenItems( ITEM_POOL *pItemPool );
|
BOOLEAN DoesItemPoolContainAllHiddenItems( ITEM_POOL *pItemPool );
|
||||||
|
|||||||
@@ -650,7 +650,7 @@ void HandleFencePartnerCheck( INT32 sStructGridNo )
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN ExplosiveDamageStructureAtGridNo( STRUCTURE * pCurrent, STRUCTURE **ppNextCurrent, INT32 sGridNo, INT16 sWoundAmt, UINT32 uiDist,
|
INT8 ExplosiveDamageStructureAtGridNo( STRUCTURE * pCurrent, STRUCTURE **ppNextCurrent, INT32 sGridNo, INT16 sWoundAmt, UINT32 uiDist,
|
||||||
BOOLEAN *pfRecompileMovementCosts, BOOLEAN fOnlyWalls, BOOLEAN fSubSequentMultiTilesTransitionDamage, UINT8 ubOwner, INT8 bLevel,
|
BOOLEAN *pfRecompileMovementCosts, BOOLEAN fOnlyWalls, BOOLEAN fSubSequentMultiTilesTransitionDamage, UINT8 ubOwner, INT8 bLevel,
|
||||||
UINT8 ubReason )
|
UINT8 ubReason )
|
||||||
{
|
{
|
||||||
@@ -683,7 +683,7 @@ BOOLEAN ExplosiveDamageStructureAtGridNo( STRUCTURE * pCurrent, STRUCTURE **ppNe
|
|||||||
if ( DoesO3SectorStatueExistHere( sGridNo ) && uiDist <= 1 )
|
if ( DoesO3SectorStatueExistHere( sGridNo ) && uiDist <= 1 )
|
||||||
{
|
{
|
||||||
ChangeO3SectorStatue( TRUE );
|
ChangeO3SectorStatue( TRUE );
|
||||||
return( TRUE );
|
return( 1 );
|
||||||
}
|
}
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
//JA25 UB
|
//JA25 UB
|
||||||
@@ -706,12 +706,12 @@ BOOLEAN ExplosiveDamageStructureAtGridNo( STRUCTURE * pCurrent, STRUCTURE **ppNe
|
|||||||
// ATE: Continue if we are only looking for walls
|
// ATE: Continue if we are only looking for walls
|
||||||
if ( fOnlyWalls && !( pCurrent->fFlags & STRUCTURE_WALLSTUFF ) )
|
if ( fOnlyWalls && !( pCurrent->fFlags & STRUCTURE_WALLSTUFF ) )
|
||||||
{
|
{
|
||||||
return( TRUE );
|
return( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( bLevel > 0 )
|
if ( bLevel > 0 )
|
||||||
{
|
{
|
||||||
return( TRUE );
|
return( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is this a corpse?
|
// Is this a corpse?
|
||||||
@@ -747,7 +747,9 @@ BOOLEAN ExplosiveDamageStructureAtGridNo( STRUCTURE * pCurrent, STRUCTURE **ppNe
|
|||||||
pBase->fFlags & STRUCTURE_OPENABLE &&
|
pBase->fFlags & STRUCTURE_OPENABLE &&
|
||||||
!(pBase->fFlags & STRUCTURE_DOOR ) )
|
!(pBase->fFlags & STRUCTURE_DOOR ) )
|
||||||
{
|
{
|
||||||
RemoveAllUnburiedItems( pBase->sGridNo, bLevel );
|
// explosions destroy items inside
|
||||||
|
if ( ubReason == STRUCTURE_DAMAGE_EXPLOSION )
|
||||||
|
RemoveAllUnburiedItems( pBase->sGridNo, bLevel );
|
||||||
}
|
}
|
||||||
|
|
||||||
fExplosive = ( ( pCurrent->fFlags & STRUCTURE_EXPLOSIVE ) != 0 );
|
fExplosive = ( ( pCurrent->fFlags & STRUCTURE_EXPLOSIVE ) != 0 );
|
||||||
@@ -1315,7 +1317,7 @@ BOOLEAN ExplosiveDamageStructureAtGridNo( STRUCTURE * pCurrent, STRUCTURE **ppNe
|
|||||||
|
|
||||||
if ( docontinue == 2 )
|
if ( docontinue == 2 )
|
||||||
{
|
{
|
||||||
return( FALSE );
|
return( 1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1917,6 +1917,9 @@ INT8 DamageStructure( STRUCTURE * pStructure, UINT8 ubDamage, UINT8 ubReason, IN
|
|||||||
}
|
}
|
||||||
|
|
||||||
RecompileLocalMovementCostsFromRadius( tmpgridno, 2 );
|
RecompileLocalMovementCostsFromRadius( tmpgridno, 2 );
|
||||||
|
|
||||||
|
// if we've destroyed a structure, reveal the things inside, as destroying a structure doesn't necessarily destroy the contents inside
|
||||||
|
RevealAllUnburiedItems( tmpgridno, 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1957,6 +1960,9 @@ INT8 DamageStructure( STRUCTURE * pStructure, UINT8 ubDamage, UINT8 ubReason, IN
|
|||||||
}
|
}
|
||||||
|
|
||||||
RecompileLocalMovementCostsFromRadius( tmpgridno, 2 );
|
RecompileLocalMovementCostsFromRadius( tmpgridno, 2 );
|
||||||
|
|
||||||
|
// if we've destroyed a structure, reveal the things inside, as destroying a structure doesn't necessarily destroy the contents inside
|
||||||
|
RevealAllUnburiedItems( tmpgridno, 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user