Skip to content
Permalink
Browse files

game: ensure weapon state is valid while alt switch check, refs #1288

  • Loading branch information
Aranud committed Jan 7, 2020
1 parent ddf636d commit 2dc4db7810d0c0ade4cc75cd5739e574629d80e0
Showing with 10 additions and 10 deletions.
  1. +10 −10 src/game/bg_pmove.c
@@ -254,7 +254,7 @@ void PM_ClipVelocity(vec3_t in, vec3_t normal, vec3_t out, float overbounce)
* @param[in] ignoreent
* @param[in] tracemask
*/
void PM_TraceLegs(trace_t *trace, float *legsOffset, vec3_t start, vec3_t end, trace_t *bodytrace, vec3_t viewangles, void(tracefunc) (trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentMask), int ignoreent, int tracemask)
void PM_TraceLegs(trace_t *trace, float *legsOffset, vec3_t start, vec3_t end, trace_t *bodytrace, vec3_t viewangles, void (tracefunc) (trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentMask), int ignoreent, int tracemask)
{
vec3_t ofs, org, point;
vec3_t flatforward;
@@ -335,13 +335,13 @@ void PM_TraceLegs(trace_t *trace, float *legsOffset, vec3_t start, vec3_t end, t
* @param[in] tracemask
*/
void PM_TraceHead(trace_t *trace, vec3_t start, vec3_t end, trace_t *bodytrace, vec3_t viewangles,
void(tracefunc) (trace_t *results,
const vec3_t start,
const vec3_t mins,
const vec3_t maxs,
const vec3_t end,
int passEntityNum,
int contentMask),
void (tracefunc) (trace_t *results,
const vec3_t start,
const vec3_t mins,
const vec3_t maxs,
const vec3_t end,
int passEntityNum,
int contentMask),
int ignoreent,
int tracemask)
{
@@ -2382,7 +2382,7 @@ static void PM_BeginWeaponChange(weapon_t oldWeapon, weapon_t newWeapon, qboolea
// don't allow another weapon switch when we're still swapping alt weap, to prevent animation breaking
// there we check the value of the animation to prevent any switch during raising and dropping alt weapon
// until the animation is ended
if (GetWeaponTableData(oldWeapon)->weapAlts &&
if (GetWeaponTableData(oldWeapon)->weapAlts && pm->ps->weaponstate == WEAPON_RAISING &&
((pm->ps->weapAnim & ~ANIM_TOGGLEBIT) == WEAP_ALTSWITCHFROM || (pm->ps->weapAnim & ~ANIM_TOGGLEBIT) == WEAP_ALTSWITCHTO))
{
return;
@@ -3968,7 +3968,7 @@ void PM_UpdateLean(playerState_t *ps, usercmd_t *cmd, pmove_t *tpm)
*
* @note Tnused trace parameter
*/
void PM_UpdateViewAngles(playerState_t *ps, pmoveExt_t *pmext, usercmd_t *cmd, void(trace) (trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentMask), int tracemask) // modified
void PM_UpdateViewAngles(playerState_t *ps, pmoveExt_t *pmext, usercmd_t *cmd, void (trace) (trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentMask), int tracemask) // modified
{
short temp;
int i;

0 comments on commit 2dc4db7

Please sign in to comment.
You can’t perform that action at this time.