mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
cleaner get_ambient_channel
This commit is contained in:
parent
3eabe24f12
commit
a93240d2a6
@ -360,20 +360,10 @@ impl AudioFrontend {
|
|||||||
channel_tag: AmbientChannelTag,
|
channel_tag: AmbientChannelTag,
|
||||||
) -> Option<&mut AmbientChannel> {
|
) -> Option<&mut AmbientChannel> {
|
||||||
if self.audio_stream.is_some() {
|
if self.audio_stream.is_some() {
|
||||||
let mut tag_match = false;
|
self.ambient_channels.iter_mut().find(|channel| channel.get_tag() == channel_tag)
|
||||||
let mut found_channel = None;
|
} else {
|
||||||
for channel in self.ambient_channels.iter_mut() {
|
None
|
||||||
if channel.get_tag() == channel_tag {
|
|
||||||
tag_match = true;
|
|
||||||
found_channel = Some(channel);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if tag_match {
|
|
||||||
return found_channel;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
None
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unused code that may be useful in the future:
|
// Unused code that may be useful in the future:
|
||||||
|
Loading…
Reference in New Issue
Block a user