| 41 | } |
| 42 | |
| 43 | void CActor::g_cl_ValidateMState(float dt, u32 mstate_wf) |
| 44 | { |
| 45 | // Lookout |
| 46 | if ((mstate_wf & mcLLookout) && (mstate_wf & mcRLookout)) |
| 47 | { |
| 48 | // It's impossible to perform right and left lookouts in the same time |
| 49 | mstate_real &= ~mcLookout; |
| 50 | } |
| 51 | else if (mstate_wf & mcLookout) |
| 52 | { |
| 53 | // Activate one of lookouts |
| 54 | mstate_real |= mstate_wf & mcLookout; |
| 55 | } |
| 56 | else |
| 57 | { |
| 58 | // No lookouts needed |
| 59 | mstate_real &= ~mcLookout; |
| 60 | } |
| 61 | |
| 62 | if (mstate_real & (mcJump | mcFall | mcLanding | mcLanding2)) |
| 63 | mstate_real &= ~mcLookout; |
| 64 | |
| 65 | // закончить приземление |
| 66 | if (mstate_real & (mcLanding | mcLanding2)) |
| 67 | { |
| 68 | m_fLandingTime -= dt; |
| 69 | if (m_fLandingTime <= 0.f) |
| 70 | { |
| 71 | mstate_real &= ~(mcLanding | mcLanding2); |
| 72 | mstate_real &= ~(mcFall | mcJump); |
| 73 | } |
| 74 | } |
| 75 | // закончить падение |
| 76 | if (character_physics_support()->movement()->gcontact_Was) |
| 77 | { |
| 78 | if (mstate_real & mcFall) |
| 79 | { |
| 80 | if (character_physics_support()->movement()->GetContactSpeed() > 4.f) |
| 81 | { |
| 82 | if (fis_zero(character_physics_support()->movement()->gcontact_HealthLost)) |
| 83 | { |
| 84 | m_fLandingTime = s_fLandingTime1; |
| 85 | mstate_real |= mcLanding; |
| 86 | } |
| 87 | else |
| 88 | { |
| 89 | m_fLandingTime = s_fLandingTime2; |
| 90 | mstate_real |= mcLanding2; |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | // CActor_on_land |
| 95 | |
| 96 | this->callback(GameObject::eOnActorLand)(this->lua_game_object(), character_physics_support()->movement()->GetContactSpeed()); |
| 97 | } |
| 98 | m_bJumpKeyPressed = TRUE; |
| 99 | m_fJumpTime = s_fJumpTime; |
| 100 | mstate_real &= ~(mcFall | mcJump); |
nothing calls this directly
no test coverage detected