fix a WML crash when an else statement was the last in an animation
This commit is contained in:
parent
ba5a1a48c6
commit
9d3c5cc012
1 changed files with 3 additions and 3 deletions
|
@ -52,8 +52,8 @@ config unit_animation::prepare_animation(const config &cfg,const std::string ani
|
||||||
expanded_chunk.append(*(*child).second);
|
expanded_chunk.append(*(*child).second);
|
||||||
to_add.push_back(expanded_chunk);
|
to_add.push_back(expanded_chunk);
|
||||||
child++;
|
child++;
|
||||||
if(*(*child).first == "else") {
|
if(child != analyzed_anim.ordered_end() && *(*child).first == "else") {
|
||||||
while(*(*child).first == "else") {
|
while(child != analyzed_anim.ordered_end() && *(*child).first == "else") {
|
||||||
expanded_chunk = expanded_anim;
|
expanded_chunk = expanded_anim;
|
||||||
// add the content of else to the stored one
|
// add the content of else to the stored one
|
||||||
expanded_chunk.append(*(*child).second);
|
expanded_chunk.append(*(*child).second);
|
||||||
|
@ -63,7 +63,7 @@ config unit_animation::prepare_animation(const config &cfg,const std::string ani
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// add an animw with the if part removed
|
// add an anim with the if part removed
|
||||||
to_add.push_back(expanded_anim);
|
to_add.push_back(expanded_anim);
|
||||||
}
|
}
|
||||||
// copy the end of the anim "as is" other if will be treated later
|
// copy the end of the anim "as is" other if will be treated later
|
||||||
|
|
Loading…
Add table
Reference in a new issue