object GetGoodCoffin( object oSeeker, int bShade = FALSE ) { object oCoffin, oResult; string sTag = GetTag( oSeeker ); int i = 0; if( !bShade ) sTag += "_SHAD"; oCoffin = GetObjectByTag( sTag, i ); while( GetIsObjectValid( oCoffin ) ) { if( GetObjectType( oCoffin ) == OBJECT_TYPE_PLACEABLE && !GetLocalInt( oCoffin, "VAMPIRE_INSIDE" ) ) oResult = oCoffin; oCoffin = GetObjectByTag( sTag, ++i ); } // while valid coffin return oResult; } void CloseInterveningDoors( object oWalker, object oTarget ) { object oArea = GetArea( oTarget ); if( GetArea( oWalker ) == oArea ) return; object oDoor = GetFirstObjectInArea( GetArea( OBJECT_SELF ) ); while( GetIsObjectValid( oDoor ) ) { if( GetArea( GetTransitionTarget( oDoor ) ) == oArea ) AssignCommand( oDoor, ActionCloseDoor( oDoor ) ); oDoor = GetNextObjectInArea(); } } // void main(){}