Skip to content

Commit 29c2c1a

Browse files
Fix Level attributes being parsed inconsistently
1 parent d0fba1c commit 29c2c1a

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

lib/src/maps/elements/level.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,12 @@ impl MapElement for Level {
129129
encoder.attribute("musicProgress", progress.clone());
130130
}
131131
encoder.optional_attribute("ambience", &self.ambience);
132-
if let Some(progress) = &self.ambience_progress {
133-
encoder.attribute("ambienceProgress", progress.clone());
134-
}
132+
encoder.optional_attribute("ambienceProgress", &self.ambience_progress);
135133
encoder.attribute("underwater", self.underwater);
136134
encoder.optional_attribute("space", &self.space);
137135
encoder.optional_attribute("disableDownTransition", &self.disable_down_transition);
138-
if let Some(whisper) = self.whisper {
139-
encoder.attribute("whisper", whisper);
140-
}
141-
142-
if let Some(alt_music_fade) = self.delay_alt_music_fade {
143-
encoder.attribute("delayAltMusicFade", alt_music_fade);
144-
}
136+
encoder.optional_attribute("whisper", &self.whisper);
137+
encoder.optional_attribute("delayAltMusicFade", &self.delay_alt_music_fade);
145138
encoder.optional_attribute("enforceDashNumber", &self.enforce_dash_number);
146139
encoder.attribute("x", self.x);
147140
encoder.attribute("y", self.y);

0 commit comments

Comments
 (0)