| 171 | static bool crouch_stop = false; |
| 172 | |
| 173 | void CActor::g_cl_CheckControls(u32 mstate_wf, Fvector& vControlAccel, float& Jump, float dt) |
| 174 | { |
| 175 | float cam_eff_factor = 0.0f; |
| 176 | mstate_old = mstate_real; |
| 177 | vControlAccel.set(0, 0, 0); |
| 178 | |
| 179 | if (!(mstate_real & mcFall) && (character_physics_support()->movement()->Environment() == CPHMovementControl::peInAir)) |
| 180 | { |
| 181 | m_fFallTime -= dt; |
| 182 | if (m_fFallTime <= 0.f) |
| 183 | { |
| 184 | m_fFallTime = s_fFallTime; |
| 185 | mstate_real |= mcFall; |
| 186 | mstate_real &= ~mcJump; |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | if (!CanMove()) |
| 191 | { |
| 192 | if (mstate_wf & mcAnyMove) |
| 193 | { |
| 194 | StopAnyMove(); |
| 195 | mstate_wf &= ~mcAnyMove; |
| 196 | mstate_wf &= ~mcJump; |
| 197 | } |
| 198 | // character_physics_support()->movement()->EnableCharacter(); |
| 199 | // return; |
| 200 | } |
| 201 | |
| 202 | // update player accel |
| 203 | if (mstate_wf & mcFwd) |
| 204 | vControlAccel.z += 1; |
| 205 | if (mstate_wf & mcBack) |
| 206 | vControlAccel.z += -1; |
| 207 | if (mstate_wf & mcLStrafe) |
| 208 | vControlAccel.x += -1; |
| 209 | if (mstate_wf & mcRStrafe) |
| 210 | vControlAccel.x += 1; |
| 211 | |
| 212 | if (character_physics_support()->movement()->Environment() == CPHMovementControl::peOnGround || |
| 213 | character_physics_support()->movement()->Environment() == CPHMovementControl::peAtWall) |
| 214 | { |
| 215 | // crouch |
| 216 | if ((mstate_real & mcCrouch) == 0 && (mstate_wf & mcCrouch)) |
| 217 | { |
| 218 | if (mstate_real & mcClimb) |
| 219 | { |
| 220 | mstate_wf &= ~mcCrouch; |
| 221 | } |
| 222 | else |
| 223 | { |
| 224 | character_physics_support()->movement()->EnableCharacter(); |
| 225 | bool Crouched = false; |
| 226 | if (isActorAccelerated(mstate_wf, IsZoomAimingMode())) |
| 227 | Crouched = character_physics_support()->movement()->ActivateBoxDynamic((mstate_wf & mcAnyMove) ? 3 : 1); |
| 228 | else |
| 229 | Crouched = character_physics_support()->movement()->ActivateBoxDynamic((mstate_wf & mcAnyMove) ? 4 : 2); |
| 230 | if (Crouched) |
nothing calls this directly
no test coverage detected