luanti-org/luanti

Entity sprite animations are not started for newly connected clients

Open

#15,107 opened on Sep 1, 2024

View on GitHub
 (3 comments) (0 reactions) (0 assignees)C++ (2,395 forks)auto 404
@ Client / AudiovisualsBuggood first issue

Repository metrics

Stars
 (13,341 stars)
PR merge metrics
 (PR metrics pending)

Description

Minetest version

At least from Minetest 5.4.0 up to 5.9.0, didn't test anything earlier

Irrlicht device

No response

Operating system and version

Devuan Daedalus (eq to Debian Bookworm)

CPU model

No response

GPU model

No response

Active renderer

No response

Summary

When an entity is added, and the sprite animation is started with object:set_sprite(), the animation plays for all currently connected players. However, when someone else connects, the animation status is not sent with the object, and it appears static and non-animated.

This can be worked around by re-running set-sprite() for new clients, either by detecting them somehow (which is clumsy) or better yet, by calculating when the animation would loop around to the first frame and having the on_step restart the animation there (or whenever, if you don't care if your animation jumps) but these workarounds suck.

Steps to reproduce

Host a devtest game. Load the code from #15105 and left- or right-click with the animtest:sprite_item to place an entity. Connect from another client to see the unanimated sprite sit there and be boring, before it times out.

Contributor guide