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

Function LocalPlayer_HandleInput

src/Entity.c:695–714  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

693}
694
695static void LocalPlayer_HandleInput(struct LocalPlayer* p, float* xMoving, float* zMoving) {
696 struct HacksComp* hacks = &p->Hacks;
697 struct LocalPlayerInput* input;
698 if (Gui.InputGrab) return;
699
700 /* keyboard input, touch, joystick, etc */
701 for (input = sources_head; input; input = input->next) {
702 input->GetMovement(p, xMoving, zMoving);
703 }
704 *xMoving *= 0.98f;
705 *zMoving *= 0.98f;
706
707 if (hacks->WOMStyleHacks && hacks->Enabled && hacks->CanNoclip) {
708 if (hacks->Noclip) {
709 /* need a { } block because it's a macro */
710 Vec3_Set(p->Base.Velocity, 0,0,0);
711 }
712 HacksComp_SetNoclip(hacks, hacks->_noclipping);
713 }
714}
715
716static void LocalPlayer_SetLocation(struct Entity* e, struct LocationUpdate* update) {
717 struct LocalPlayer* p = (struct LocalPlayer*)e;

Callers 1

LocalPlayer_TickFunction · 0.85

Calls 1

HacksComp_SetNoclipFunction · 0.85

Tested by

no test coverage detected