fix a WML crash when an else statement was the last in an animation

This commit is contained in:
Jérémy Rosen 2006-09-03 12:19:09 +00:00
parent ba5a1a48c6
commit 9d3c5cc012

View file

@ -52,8 +52,8 @@ config unit_animation::prepare_animation(const config &cfg,const std::string ani
expanded_chunk.append(*(*child).second);
to_add.push_back(expanded_chunk);
child++;
if(*(*child).first == "else") {
while(*(*child).first == "else") {
if(child != analyzed_anim.ordered_end() && *(*child).first == "else") {
while(child != analyzed_anim.ordered_end() && *(*child).first == "else") {
expanded_chunk = expanded_anim;
// add the content of else to the stored one
expanded_chunk.append(*(*child).second);
@ -63,7 +63,7 @@ config unit_animation::prepare_animation(const config &cfg,const std::string ani
}
} else {
// add an animw with the if part removed
// add an anim with the if part removed
to_add.push_back(expanded_anim);
}
// copy the end of the anim "as is" other if will be treated later