diff --git a/.gitignore b/.gitignore index f109fe19b26..6821852a678 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,10 @@ build.*/ **/CMakeFiles/ **/CMakeCache.txt supertux2 + +# Tags file +tags + # Windows build files Debug/ Release/ diff --git a/data/images/creatures/snowball/snowball.sprite b/data/images/creatures/snowball/snowball.sprite index 922a256f24d..eaeea91ce83 100644 --- a/data/images/creatures/snowball/snowball.sprite +++ b/data/images/creatures/snowball/snowball.sprite @@ -9,7 +9,6 @@ ) (action (name "right") - (hitbox 3 4 32 32) (mirror-action "left") ) (action @@ -19,7 +18,6 @@ ) (action (name "squished-right") - (hitbox 1 -19 31.8 31.8) (mirror-action "squished-left") ) (action @@ -31,7 +29,6 @@ "sport-melting-3.png")) (action (name "melting-right") - (hitbox 3 4 32 32) (mirror-action "melting-left")) (action (name "ground-melting-left") diff --git a/src/sprite/sprite_data.cpp b/src/sprite/sprite_data.cpp index 0805b569479..21b42fe4545 100644 --- a/src/sprite/sprite_data.cpp +++ b/src/sprite/sprite_data.cpp @@ -111,8 +111,25 @@ SpriteData::parse_action(const ReaderMapping& mapping) max_h = std::max(max_h, static_cast(surface->get_height())); action->surfaces.push_back(surface); } - if (action->hitbox_w < 1) action->hitbox_w = max_w - action->x_offset; - if (action->hitbox_h < 1) action->hitbox_h = max_h - action->y_offset; + + if (action->hitbox_w < 1 && action->hitbox_h < 1) + { + action->hitbox_w = act_tmp->hitbox_w; + action->hitbox_h = act_tmp->hitbox_h; + action->x_offset = act_tmp->x_offset; + action->y_offset = act_tmp->y_offset; + } + + if (!action->has_custom_loops && act_tmp->has_custom_loops) + { + action->has_custom_loops = act_tmp->has_custom_loops; + action->loops = act_tmp->loops; + } + + if (action->fps == 0) + { + action->fps = act_tmp->fps; + } } } else if (mapping.get("clone-action", clone_action)) { const auto* act_tmp = get_action(clone_action);