mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
- if a a roof collapses, any structures built on it (fans, sandbags) are destroyed
- if a a roof collapses, any corpses on it are moved to the floor git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7623 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -461,6 +461,22 @@ BOOLEAN LoadAllMapChangesFromMapTempFileAndApplyThem( )
|
||||
++uiNumberOfElementsSavedBackToFile;
|
||||
break;
|
||||
case SLM_REMOVE_ONROOF:
|
||||
if ( pMap->usImageType >= FIRSTTEXTURE && pMap->usImageType <= WIREFRAMES )
|
||||
{
|
||||
RemoveAllOnRoofsOfTypeRange( pMap->usGridNo, FIRSTTEXTURE, WIREFRAMES );
|
||||
}
|
||||
else
|
||||
{
|
||||
GetTileIndexFromTypeSubIndex( pMap->usImageType, pMap->usSubImageIndex, &usIndex );
|
||||
|
||||
RemoveOnRoofAdjustSavefile( pMap->usGridNo, usIndex );
|
||||
}
|
||||
|
||||
// Save this struct back to the temp file
|
||||
SaveModifiedMapStructToMapTempFile( pMap, gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
|
||||
|
||||
//Since the element is being saved back to the temp file, increment the #
|
||||
++uiNumberOfElementsSavedBackToFile;
|
||||
break;
|
||||
case SLM_REMOVE_TOPMOST:
|
||||
break;
|
||||
@@ -706,6 +722,33 @@ void RemoveRoofFromMapTempFile( INT32 uiMapIndex, UINT16 usIndex )
|
||||
SaveModifiedMapStructToMapTempFile( &Map, gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
|
||||
}
|
||||
|
||||
void RemoveOnRoofFromMapTempFile( INT32 uiMapIndex, UINT16 usIndex )
|
||||
{
|
||||
MODIFY_MAP Map;
|
||||
UINT32 uiType;
|
||||
UINT16 usSubIndex;
|
||||
|
||||
if ( !gfApplyChangesToTempFile )
|
||||
return;
|
||||
|
||||
if ( gTacticalStatus.uiFlags & LOADING_SAVED_GAME )
|
||||
return;
|
||||
|
||||
GetTileType( usIndex, &uiType );
|
||||
GetSubIndexFromTileIndex( usIndex, &usSubIndex );
|
||||
|
||||
memset( &Map, 0, sizeof(MODIFY_MAP) );
|
||||
|
||||
Map.usGridNo = uiMapIndex;
|
||||
// Map.usIndex = usIndex;
|
||||
Map.usImageType = (UINT16)uiType;
|
||||
Map.usSubImageIndex = usSubIndex;
|
||||
|
||||
Map.ubType = SLM_REMOVE_ONROOF;
|
||||
|
||||
SaveModifiedMapStructToMapTempFile( &Map, gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
|
||||
}
|
||||
|
||||
|
||||
void RemoveSavedStructFromMap( INT32 uiMapIndex, UINT16 usIndex )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user