MCPcopy Create free account
hub / github.com/cuberite/cuberite / HandlePlayerMoveLook

Method HandlePlayerMoveLook

src/ClientHandle.cpp:1208–1232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1206
1207
1208void cClientHandle::HandlePlayerMoveLook(double a_PosX, double a_PosY, double a_PosZ, double a_Stance, float a_Rotation, float a_Pitch, bool a_IsOnGround)
1209{
1210 if ((m_Player == NULL) || (m_State != csPlaying))
1211 {
1212 // The client hasn't been spawned yet and sends nonsense, we know better
1213 return;
1214 }
1215
1216 /*
1217 // TODO: Invalid stance check
1218 if ((a_PosY >= a_Stance) || (a_Stance > a_PosY + 1.65))
1219 {
1220 LOGD("Invalid stance");
1221 SendPlayerMoveLook();
1222 return;
1223 }
1224 */
1225
1226 m_Player->MoveTo(Vector3d(a_PosX, a_PosY, a_PosZ));
1227 m_Player->SetStance (a_Stance);
1228 m_Player->SetTouchGround(a_IsOnGround);
1229 m_Player->SetHeadYaw (a_Rotation);
1230 m_Player->SetYaw (a_Rotation);
1231 m_Player->SetPitch (a_Pitch);
1232}
1233
1234
1235

Callers 2

ParsePlayerMoveLookMethod · 0.80

Calls 6

MoveToMethod · 0.80
SetStanceMethod · 0.80
SetTouchGroundMethod · 0.80
SetHeadYawMethod · 0.80
SetYawMethod · 0.80
SetPitchMethod · 0.45

Tested by

no test coverage detected