Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void do_movements(playerinfo_t &plrinfo, bool unduckable_onto_ground)
- {
- // If we are going to unduck onto ground, set the position type correctly
- // so that the strafing stuff later will be correct.
- if (unduckable_onto_ground && plrinfo.postype == PositionAir &&
- !(p_in_duck->state & 1) && duck_action != 1 && jump_action != 1)
- plrinfo.postype = PositionGround;
- // If we are going to ducktap
- if (get_duckstate() == 1 && duck_action != 1 && !(p_in_duck->state & 1) &&
- is_unduckable(plrinfo))
- plrinfo.postype = PositionAir;
- // If we are going to jump
- if ((jump_action == 1 || p_in_jump->state & 1) &&
- !is_jump_in_oldbuttons() && plrinfo.postype == PositionGround) {
- plrinfo.postype = PositionAir;
- if (tas_dwj) {
- tas_dwj--;
- duck_action = 1;
- }
- }
- if (do_tas_s2y.do_it) {
- convert_s2y_to_sba(plrinfo);
- do_tas_s2y.do_it = false;
- do_tas_sba.do_it = true;
- }
- if (do_tas_sba.do_it) {
- double speed = std::hypot(plrinfo.vel[0], plrinfo.vel[1]);
- if (speed < 0.1) {
- prev_unitvel[0] = std::cos(plrinfo.viewangles[1] * M_PI / 180);
- prev_unitvel[1] = std::sin(plrinfo.viewangles[1] * M_PI / 180);
- } else {
- prev_unitvel[0] = plrinfo.vel[0] / speed;
- prev_unitvel[1] = plrinfo.vel[1] / speed;
- }
- // The strafe by angle functionality remains active. Setting do_it to
- // false simply means we will not update prev_unitvel here for the
- // subsequent frames.
- do_tas_sba.do_it = false;
- }
- load_player_movevars(plrinfo);
- add_correct_gravity(plrinfo);
- if (g_moveaction == StrafeNone)
- do_strafe_none(plrinfo);
- else
- do_strafe_tas(plrinfo);
- orig_SetViewAngles(plrinfo.viewangles);
- update_position(plrinfo);
- do_tassba(plrinfo);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement