summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2013-12-19 17:03:43 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2013-12-19 17:03:43 +0100
commit53e8c067eabb7eb024c84bf0e2af9c81d30f2acd (patch)
tree761db8d9a966eca727613b033cbdc32bad34e88c /src/ClientHandle.cpp
parentFixed dust from being placed on nonsolids (diff)
downloadcuberite-53e8c067eabb7eb024c84bf0e2af9c81d30f2acd.tar
cuberite-53e8c067eabb7eb024c84bf0e2af9c81d30f2acd.tar.gz
cuberite-53e8c067eabb7eb024c84bf0e2af9c81d30f2acd.tar.bz2
cuberite-53e8c067eabb7eb024c84bf0e2af9c81d30f2acd.tar.lz
cuberite-53e8c067eabb7eb024c84bf0e2af9c81d30f2acd.tar.xz
cuberite-53e8c067eabb7eb024c84bf0e2af9c81d30f2acd.tar.zst
cuberite-53e8c067eabb7eb024c84bf0e2af9c81d30f2acd.zip
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r--src/ClientHandle.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 9565fc41f..de0a57a0a 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -1065,7 +1065,29 @@ void cClientHandle::HandleAnimation(char a_Animation)
// Plugin disagrees, bail out
return;
}
-
+
+ // Because the animation ID sent to servers by clients are different to those sent back, we need this
+ switch (a_Animation)
+ {
+ case 0: // No animation - wiki.vg doesn't say that client has something specific for it, so I suppose it will just become -1
+ case 1:
+ case 2:
+ case 3:
+ {
+ a_Animation--; // Offset by -1
+ break;
+ }
+ case 5:
+ case 6:
+ case 7:
+ {
+ a_Animation -= 2; // Offset by -2
+ break;
+ }
+ default: // Anything else is the same
+ break;
+ }
+
m_Player->GetWorld()->BroadcastEntityAnimation(*m_Player, a_Animation, this);
}