MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / CPE_HackControl

Function CPE_HackControl

src/Protocol.c:1260–1278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1258}
1259
1260static void CPE_HackControl(cc_uint8* data) {
1261 struct LocalPlayer* p = Entities.CurPlayer;
1262 int jumpHeight;
1263
1264 p->Hacks.CanFly = data[0] != 0;
1265 p->Hacks.CanNoclip = data[1] != 0;
1266 p->Hacks.CanSpeed = data[2] != 0;
1267 p->Hacks.CanRespawn = data[3] != 0;
1268 p->Hacks.CanUseThirdPerson = data[4] != 0;
1269 HacksComp_Update(&p->Hacks);
1270 jumpHeight = Stream_GetU16_BE(data + 5);
1271
1272 if (jumpHeight == UInt16_MaxValue) { /* special value of -1 to reset default */
1273 LocalPlayer_ResetJumpVelocity(p);
1274 } else {
1275 p->Physics.JumpVel = PhysicsComp_CalcJumpVelocity(jumpHeight / 32.0f);
1276 p->Physics.ServerJumpVel = p->Physics.JumpVel;
1277 }
1278}
1279
1280static void CPE_ExtAddEntity2(cc_uint8* data) {
1281 cc_string name, skin;

Callers

nothing calls this directly

Calls 4

HacksComp_UpdateFunction · 0.85
Stream_GetU16_BEFunction · 0.85

Tested by

no test coverage detected