mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
move 'player.noclip' and 'player.flight' handlers to Lua
This commit is contained in:
parent
9164edf971
commit
3d33de502d
6 changed files with 58 additions and 43 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue