Skip to content

Commit

Permalink
Fix AudioFile::default defaulting to 0 volume
Browse files Browse the repository at this point in the history
  • Loading branch information
melody-rs committed Jul 4, 2024
1 parent ec84e01 commit b4ada77
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion crates/data/src/shared/audio_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// along with Luminol. If not, see <http://www.gnu.org/licenses/>.
use crate::{optional_path_alox, optional_path_serde, Path};

#[derive(Default, Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq)]
#[derive(serde::Deserialize, serde::Serialize)]
#[derive(alox_48::Deserialize, alox_48::Serialize)]
#[marshal(class = "RPG::AudioFile")]
Expand All @@ -27,3 +27,13 @@ pub struct AudioFile {
pub volume: u8,
pub pitch: u8,
}

impl Default for AudioFile {
fn default() -> Self {
Self {
name: None,
volume: 100,
pitch: 100,
}
}
}

0 comments on commit b4ada77

Please sign in to comment.