Entity sprite animations are not started for newly connected clients
#15,107 创建于 2024年9月1日
仓库指标
- 星标
- (13,341 个星标)
- PR 合并指标
- (平均合并 13天 22小时) (30 天内合并 48 个 PR)
描述
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.