mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 06:51:15 +02:00
Added missing checks to ground and takeoff state.
This commit is contained in:
parent
bce80130bd
commit
eb8e912808
1 changed files with 6 additions and 2 deletions
|
@ -754,7 +754,11 @@ void CharacterController::updateState() {
|
|||
switch (_state) {
|
||||
case State::Ground:
|
||||
if (!rayHasHit && !_hasSupport) {
|
||||
SET_STATE(State::Hover, "no ground detected");
|
||||
if (_useFallHeightThreshold) {
|
||||
SET_STATE(State::Hover, "no ground detected");
|
||||
} else {
|
||||
SET_STATE(State::InAir, "falling");
|
||||
}
|
||||
} else if (_pendingFlags & PENDING_FLAG_JUMP && _jumpButtonDownCount != _takeoffJumpButtonID) {
|
||||
_takeoffJumpButtonID = _jumpButtonDownCount;
|
||||
_takeoffToInAirStartTime = now;
|
||||
|
@ -764,7 +768,7 @@ void CharacterController::updateState() {
|
|||
}
|
||||
break;
|
||||
case State::Takeoff:
|
||||
if (!rayHasHit && !_hasSupport) {
|
||||
if (_useFallHeightThreshold && (!rayHasHit && !_hasSupport)) {
|
||||
SET_STATE(State::Hover, "no ground");
|
||||
} else if ((now - _takeoffToInAirStartTime) > TAKE_OFF_TO_IN_AIR_PERIOD) {
|
||||
SET_STATE(State::InAir, "takeoff done");
|
||||
|
|
Loading…
Reference in a new issue