move 'player.noclip' and 'player.flight' handlers to Lua
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user