Changeset 174:b994a2789d5f

Show
Ignore:
Timestamp:
05/18/08 23:38:09 (2 years ago)
Author:
mdoison@…
Branch:
default
Message:
  • Fix ticket #153 : assert fails in qcommon/msg.c:883
Location:
src
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • src/cgame/cg_weapons.c

    r145 r174  
    759759 
    760760/* 
    761 =============== 
    762 CG_SetWeaponLerpFrameAnimation 
    763  
    764 may include ANIM_TOGGLEBIT 
    765 =============== 
    766 */ 
    767 static void CG_SetWeaponLerpFrameAnimation( weapon_t weapon, lerpFrame_t *lf, int newAnimation ) 
    768 { 
    769   animation_t *anim; 
    770  
    771   lf->animationNumber = newAnimation; 
    772   newAnimation &= ~ANIM_TOGGLEBIT; 
    773  
    774   if( newAnimation < 0 || newAnimation >= MAX_WEAPON_ANIMATIONS ) 
    775     CG_Error( "Bad animation number: %i", newAnimation ); 
    776  
    777   anim = &cg_weapons[ weapon ].animations[ newAnimation ]; 
    778  
    779   lf->animation = anim; 
    780   lf->animationTime = lf->frameTime + anim->initialLerp; 
    781  
    782   if( cg_debugAnim.integer ) 
    783     CG_Printf( "Anim: %i\n", newAnimation ); 
    784 } 
    785  
    786 /* 
    787 =============== 
    788 CG_WeaponAnimation 
    789 =============== 
    790 */ 
    791 static void CG_WeaponAnimation( centity_t *cent, int *old, int *now, float *backLerp ) 
    792 { 
    793   lerpFrame_t   *lf = &cent->pe.weapon; 
    794   entityState_t *es = &cent->currentState; 
    795  
    796   // see if the animation sequence is switching 
    797   if( es->weaponAnim != lf->animationNumber || !lf->animation ) 
    798     CG_SetWeaponLerpFrameAnimation( es->weapon, lf, es->weaponAnim ); 
    799  
    800   CG_RunLerpFrame( lf, 1.0f ); 
    801  
    802   *old      = lf->oldFrame; 
    803   *now      = lf->frame; 
    804   *backLerp = lf->backlerp; 
    805 } 
    806  
    807 /* 
    808761================= 
    809762CG_MapTorsoToWeaponFrame 
     
    1013966  { 
    1014967    CG_PositionEntityOnTag( &gun, parent, parent->hModel, "tag_weapon" ); 
    1015     CG_WeaponAnimation( cent, &gun.oldframe, &gun.frame, &gun.backlerp ); 
    1016968 
    1017969    trap_R_AddRefEntityToScene( &gun ); 
  • src/game/bg_misc.c

    r171 r174  
    29002900  s->legsAnim = ps->legsAnim; 
    29012901  s->torsoAnim = ps->torsoAnim; 
    2902   s->weaponAnim = ps->weaponAnim; 
    29032902  s->clientNum = ps->clientNum;   // ET_PLAYER looks here instead of at number 
    29042903                    // so corpses can also reference the proper config 
     
    30093008  s->legsAnim = ps->legsAnim; 
    30103009  s->torsoAnim = ps->torsoAnim; 
    3011   s->weaponAnim = ps->weaponAnim; 
    30123010  s->clientNum = ps->clientNum;   // ET_PLAYER looks here instead of at number 
    30133011                    // so corpses can also reference the proper config 
  • src/game/bg_pmove.c

    r159 r174  
    104104/* 
    105105=================== 
    106 PM_StartWeaponAnim 
    107 =================== 
    108 */ 
    109 static void PM_StartWeaponAnim( int anim ) 
    110 { 
    111   if( pm->ps->pm_type >= PM_DEAD ) 
    112     return; 
    113  
    114   pm->ps->weaponAnim = ( ( pm->ps->weaponAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT ) 
    115     | anim; 
    116 } 
    117  
    118 /* 
    119 =================== 
    120106PM_StartLegsAnim 
    121107=================== 
     
    181167 
    182168  PM_StartTorsoAnim( anim ); 
    183 } 
    184  
    185 /* 
    186 =================== 
    187 PM_ContinueWeaponAnim 
    188 =================== 
    189 */ 
    190 static void PM_ContinueWeaponAnim( int anim ) 
    191 { 
    192   if( ( pm->ps->weaponAnim & ~ANIM_TOGGLEBIT ) == anim ) 
    193     return; 
    194  
    195   PM_StartWeaponAnim( anim ); 
    196169} 
    197170 
     
    26492622  { 
    26502623    PM_StartTorsoAnim( TORSO_DROP ); 
    2651     PM_StartWeaponAnim( WANIM_DROP ); 
    26522624  } 
    26532625} 
     
    26772649  { 
    26782650    PM_StartTorsoAnim( TORSO_RAISE ); 
    2679     PM_StartWeaponAnim( WANIM_RAISE ); 
    26802651  } 
    26812652} 
     
    26992670        PM_ContinueTorsoAnim( TORSO_STAND ); 
    27002671    } 
    2701  
    2702     PM_ContinueWeaponAnim( WANIM_IDLE ); 
    27032672  } 
    27042673} 
     
    28162785    } 
    28172786 
    2818     PM_ContinueWeaponAnim( WANIM_IDLE ); 
    2819  
    28202787    return; 
    28212788  } 
     
    28682835    //drop the weapon 
    28692836    PM_StartTorsoAnim( TORSO_DROP ); 
    2870     PM_StartWeaponAnim( WANIM_RELOAD ); 
    28712837 
    28722838    addTime = BG_Weapon( pm->ps->weapon )->reloadTime; 
     
    30443010        { 
    30453011          PM_StartTorsoAnim( TORSO_ATTACK ); 
    3046           PM_StartWeaponAnim( WANIM_ATTACK1 ); 
    30473012        } 
    30483013        break; 
     
    30503015      case WP_BLASTER: 
    30513016        PM_StartTorsoAnim( TORSO_ATTACK2 ); 
    3052         PM_StartWeaponAnim( WANIM_ATTACK1 ); 
    30533017        break; 
    30543018 
    30553019      default: 
    30563020        PM_StartTorsoAnim( TORSO_ATTACK ); 
    3057         PM_StartWeaponAnim( WANIM_ATTACK1 ); 
    30583021        break; 
    30593022    } 
     
    30733036          num %= 6; 
    30743037          PM_ForceLegsAnim( NSPA_ATTACK1 ); 
    3075           PM_StartWeaponAnim( WANIM_ATTACK1 + num ); 
    30763038        } 
    30773039        break; 
     
    30813043        { 
    30823044          PM_ForceLegsAnim( NSPA_ATTACK2 ); 
    3083           PM_StartWeaponAnim( WANIM_ATTACK7 ); 
    30843045        } 
    30853046      case WP_ALEVEL2: 
     
    30883049          num %= 6; 
    30893050          PM_ForceLegsAnim( NSPA_ATTACK1 ); 
    3090           PM_StartWeaponAnim( WANIM_ATTACK1 + num ); 
    30913051        } 
    30923052        break; 
     
    30953055        num %= 3; 
    30963056        PM_ForceLegsAnim( NSPA_ATTACK1 + num ); 
    3097         PM_StartWeaponAnim( WANIM_ATTACK1 + num ); 
    30983057        break; 
    30993058 
     
    31023061        { 
    31033062          PM_ForceLegsAnim( NSPA_ATTACK1 ); 
    3104           PM_StartWeaponAnim( WANIM_ATTACK1 ); 
    31053063        } 
    31063064        else if( attack2 ) 
    31073065        { 
    31083066          PM_ForceLegsAnim( NSPA_ATTACK2 ); 
    3109           PM_StartWeaponAnim( WANIM_ATTACK2 ); 
    31103067        } 
    31113068        else if( attack3 ) 
    31123069        { 
    31133070          PM_ForceLegsAnim( NSPA_ATTACK3 ); 
    3114           PM_StartWeaponAnim( WANIM_ATTACK3 ); 
    31153071        } 
    31163072        break; 
  • src/qcommon/q_shared.h

    r148 r174  
    10601060        int                     torsoAnim;              // mask off ANIM_TOGGLEBIT 
    10611061 
    1062         int                     weaponAnim;             // mask off ANIM_TOGGLEBIT 
    1063  
    10641062        int                     movementDir;    // a number 0 to 7 that represents the reletive angle 
    10651063                                                                // of movement to the view angle (axial and diagonals) 
     
    12171215        int             legsAnim;               // mask off ANIM_TOGGLEBIT 
    12181216        int             torsoAnim;              // mask off ANIM_TOGGLEBIT 
    1219         int             weaponAnim;             // mask off ANIM_TOGGLEBIT 
    12201217 
    12211218        int             generic1;