Poikilos / EnlivenMinetest

Minetest engine server management tools and ENLIVEN game installer/updater

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

object:get_animation doesn't do what the documentation says. It gets the first table ({x, y}, that is, startframe and endframe)

Poikilos opened this issue · comments

For get_animation documentation, see [lua_api.txt#L6560]

It says:

* `get_animation()`: returns `range`, `frame_speed`, `frame_blend` and
  `frame_loop`.

However, it actually returns range, a table like:

{
  x,  -- start frame no.
  y,  -- end frame no.
}

To fix it so it works like the documentation, it could be changed to return a backward-compatible table:

{
  x,  -- start frame no.
  y,  -- end frame no.
  range = {
    start_frame,  -- same as x
    end_frame  -- same as y
  },
  frame_speed,   -- frames per second
  frame_blend,  -- float
  frame_loop -- boolean
}
  • also providing the current_frame in there would be ideal (for issue #561)