MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / g_cl_ValidateMState

Method g_cl_ValidateMState

ogsr_engine/xrGame/Actor_Movement.cpp:43–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43void 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);

Callers

nothing calls this directly

Calls 12

fis_zeroFunction · 0.85
isActorAcceleratedFunction · 0.85
movementMethod · 0.80
GetContactSpeedMethod · 0.80
lua_game_objectMethod · 0.80
GetVelocityActualMethod · 0.80
EnvironmentMethod · 0.80
EnableCharacterMethod · 0.80
ActivateBoxDynamicMethod · 0.80
CurrentControlEntityMethod · 0.80
callbackMethod · 0.45

Tested by

no test coverage detected