move 'player.noclip' and 'player.flight' handlers to Lua

This commit is contained in:
MihailRis
2024-12-23 13:51:12 +03:00
parent 9164edf971
commit 3d33de502d
6 changed files with 58 additions and 43 deletions
-11
View File
@@ -135,18 +135,7 @@ void Player::updateInput(PlayerInput& input, float delta) {
hitbox->velocity.y = JUMP_FORCE;
}
if ((input.flight && !noclip) || (input.noclip && flight == noclip)) {
flight = !flight;
if (flight) {
hitbox->velocity.y += 1.0f;
}
}
hitbox->type = noclip ? BodyType::KINEMATIC : BodyType::DYNAMIC;
if (input.noclip) {
noclip = !noclip;
}
input.noclip = false;
input.flight = false;
}
void Player::updateSelectedEntity() {