void EraseWalls( UINT32 iMapIndex ) { AddToUndoList( iMapIndex ); RemoveAllStructsOfTypeRange( iMapIndex, FIRSTTEXTURE, LASTITEM ); RemoveAllShadowsOfTypeRange( iMapIndex, FIRSTWALL, LASTWALL ); RemoveAllShadowsOfTypeRange( iMapIndex, FIRSTDOORSHADOW, LASTDOORSHADOW ); RemoveAllObjectsOfTypeRange( iMapIndex, DEBRISROCKS, LASTDEBRIS ); RemoveAllTopmostsOfTypeRange( iMapIndex, WIREFRAMES, WIREFRAMES ); RemoveAllObjectsOfTypeRange( iMapIndex, DEBRIS2MISC, DEBRIS2MISC ); RemoveAllObjectsOfTypeRange( iMapIndex, ANOTHERDEBRIS, ANOTHERDEBRIS ); }
void ExtractAndUpdateDoorInfo() { LEVELNODE* pNode; INT32 num; DOOR door; BOOLEAN fCursor = FALSE; BOOLEAN fCursorExists = FALSE; memset( &door, 0, sizeof( DOOR ) ); door.sGridNo = (INT16)iDoorMapIndex; num = min( GetNumericStrictValueFromField( 0 ), NUM_LOCKS-1 ); door.ubLockID = (UINT8)num; SetInputFieldStringWithNumericStrictValue( 0, num ); if( num >= 0 ) fCursor = TRUE; num = min( max( GetNumericStrictValueFromField( 1 ), 0 ), 10 ); door.ubTrapID = (UINT8)num; SetInputFieldStringWithNumericStrictValue( 1, num ); if( num ) fCursor = TRUE; num = min( max( GetNumericStrictValueFromField( 2 ), 0 ), 20 ); if( door.ubTrapID && !num ) num = 1; //Can't have a trap without a traplevel! door.ubTrapLevel = (UINT8)num; SetInputFieldStringWithNumericStrictValue( 2, num ); if( num ) fCursor = TRUE; if( ButtonList[ iDoorButton[ DOOR_LOCKED ] ]->uiFlags & BUTTON_CLICKED_ON ) { door.fLocked = TRUE; } else { door.fLocked = FALSE; } //Find out if we have a rotating key cursor (we will either add one or remove one) pNode = gpWorldLevelData[ iDoorMapIndex ].pTopmostHead; while( pNode ) { if( pNode->usIndex == ROTATINGKEY1 ) { fCursorExists = TRUE; break; } pNode = pNode->pNext; } if( fCursor ) { //we have a valid door, so add it (or replace existing) if( !fCursorExists ) AddTopmostToHead( iDoorMapIndex, ROTATINGKEY1 ); //If the door already exists, the new information will replace it. AddDoorInfoToTable( &door ); } else { //if a door exists here, remove it. if( fCursorExists ) RemoveAllTopmostsOfTypeRange( iDoorMapIndex, ROTATINGKEY, ROTATINGKEY ); RemoveDoorInfoFromTable( iDoorMapIndex ); } }