mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Support floating-point animation frame numbers
This commit is contained in:
parent
323fc0a798
commit
06907aa99b
22 changed files with 111 additions and 105 deletions
|
@ -19,6 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
#include "client/client.h"
|
||||
|
||||
#include "irr_v2d.h"
|
||||
#include "util/base64.h"
|
||||
#include "client/camera.h"
|
||||
#include "client/mesh_generator_thread.h"
|
||||
|
@ -1516,11 +1517,15 @@ void Client::handleCommand_LocalPlayerAnimations(NetworkPacket* pkt)
|
|||
LocalPlayer *player = m_env.getLocalPlayer();
|
||||
assert(player != NULL);
|
||||
|
||||
*pkt >> player->local_animations[0];
|
||||
*pkt >> player->local_animations[1];
|
||||
*pkt >> player->local_animations[2];
|
||||
*pkt >> player->local_animations[3];
|
||||
*pkt >> player->local_animation_speed;
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
if (getProtoVersion() >= 46) {
|
||||
*pkt >> player->local_animations[i];
|
||||
} else {
|
||||
v2s32 local_animation;
|
||||
*pkt >> local_animation;
|
||||
player->local_animations[i] = v2f::from(local_animation);
|
||||
}
|
||||
}
|
||||
|
||||
player->last_animation = LocalPlayerAnimation::NO_ANIM;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue