Skip to content

Commit

Permalink
🐛 emitter settings conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Roms1383 committed Dec 28, 2024
1 parent 91de836 commit 33d2d24
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion crates/audioware/src/abi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ impl SceneLifecycle for AudioSystemExt {
}
};
let emitter_settings = match TargetFootprint::try_new(emitter_settings, *entity_id) {
Ok(emitter_settings) => Some(emitter_settings),
Ok(emitter_settings) => emitter_settings,
Err(e) => {
warns!(
"{}",
Expand Down
8 changes: 2 additions & 6 deletions crates/audioware/src/abi/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,13 +395,9 @@ impl TargetFootprint {
pub fn try_new(
value: Ref<super::EmitterSettings>,
entity_id: EntityId,
) -> Result<Self, Vec<ValidationError>> {
) -> Result<Option<Self>, Vec<ValidationError>> {
use crate::engine::ToDistances;
let value = value.into_settings_ext(entity_id.to_distances());
if value.is_none() {
return Err(vec![ValidationError::InvalidEmitterSettings]);
}
Ok(Self(value.unwrap()))
Ok(value.into_settings_ext(entity_id.to_distances()).map(Self))
}
}

Expand Down
2 changes: 0 additions & 2 deletions crates/audioware/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ pub enum ValidationError {
InvalidTagName,
#[snafu(display("entity_id cannot be undefined or V."))]
InvalidTargetId,
#[snafu(display("invalid emitter_settings."))]
InvalidEmitterSettings,
}

impl From<InternalError> for Error {
Expand Down

0 comments on commit 33d2d24

Please sign in to comment.