summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2009-10-03 11:37:50 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:15:11 +0000
commitb4e0d95f4fb65741065ec857e1b4da3680a397dd (patch)
tree73da39a0a1c7c5dc9f3b2b4a803a4a1110e59a98 /src
parentbac576514472b4f1d70a53078182d29e93c34d59 (diff)
* Fix stupid 1st person animation copy and paste bug
* Add animation policies for marauder * Remove reference to shotgun_hand.md3
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_weapons.c3
-rw-r--r--src/game/bg_pmove.c80
-rw-r--r--src/game/bg_public.h5
3 files changed, 48 insertions, 40 deletions
diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c
index f9ea2985..e2f7d363 100644
--- a/src/cgame/cg_weapons.c
+++ b/src/cgame/cg_weapons.c
@@ -625,9 +625,6 @@ static qboolean CG_ParseWeaponFile( const char *filename, weaponInfo_t *wi )
strcat( path, "_hand.md3" );
wi->handsModel = trap_R_RegisterModel( path );
- if( !wi->handsModel )
- wi->handsModel = trap_R_RegisterModel( "models/weapons2/shotgun/shotgun_hand.md3" );
-
continue;
}
else if( !Q_stricmp( token, "idleSound" ) )
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c
index 5179c24c..aa3d6691 100644
--- a/src/game/bg_pmove.c
+++ b/src/game/bg_pmove.c
@@ -111,7 +111,7 @@ static void PM_StartWeaponAnim( int anim )
if( pm->ps->pm_type >= PM_DEAD )
return;
- pm->ps->weaponAnim = ( ( pm->ps->torsoAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT )
+ pm->ps->weaponAnim = ( ( pm->ps->weaponAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT )
| anim;
}
@@ -3261,44 +3261,50 @@ static void PM_Weapon( void )
}
else
{
- if( pm->ps->weapon == WP_ALEVEL4 )
- {
- //hack to get random attack animations
- int num = abs( pm->ps->commandTime ) % 3;
+ int num = abs( pm->ps->weaponTime );
- if( num == 0 )
- {
- PM_ForceLegsAnim( NSPA_ATTACK1 );
- PM_StartWeaponAnim( WANIM_ATTACK1 );
- }
- else if( num == 1 )
- {
- PM_ForceLegsAnim( NSPA_ATTACK2 );
- PM_StartWeaponAnim( WANIM_ATTACK2 );
- }
- else if( num == 2 )
- {
- PM_ForceLegsAnim( NSPA_ATTACK3 );
- PM_StartWeaponAnim( WANIM_ATTACK3 );
- }
- }
- else
+ //FIXME: it would be nice to have these hard coded policies in
+ // weapon.cfg
+ switch( pm->ps->weapon )
{
- if( attack1 )
- {
- PM_ForceLegsAnim( NSPA_ATTACK1 );
- PM_StartWeaponAnim( WANIM_ATTACK1 );
- }
- else if( attack2 )
- {
- PM_ForceLegsAnim( NSPA_ATTACK2 );
- PM_StartWeaponAnim( WANIM_ATTACK2 );
- }
- else if( attack3 )
- {
- PM_ForceLegsAnim( NSPA_ATTACK3 );
- PM_StartWeaponAnim( WANIM_ATTACK3 );
- }
+ case WP_ALEVEL2_UPG:
+ if( attack2 )
+ {
+ PM_ForceLegsAnim( NSPA_ATTACK2 );
+ PM_StartWeaponAnim( WANIM_ATTACK7 );
+ }
+ case WP_ALEVEL2:
+ if( attack1 )
+ {
+ num %= 6;
+ PM_ForceLegsAnim( NSPA_ATTACK1 );
+ PM_StartWeaponAnim( WANIM_ATTACK1 + num );
+ }
+ break;
+
+ case WP_ALEVEL4:
+ num %= 3;
+ PM_ForceLegsAnim( NSPA_ATTACK1 + num );
+ PM_StartWeaponAnim( WANIM_ATTACK1 + num );
+ break;
+
+ default:
+ if( attack1 )
+ {
+ PM_ForceLegsAnim( NSPA_ATTACK1 );
+ PM_StartWeaponAnim( WANIM_ATTACK1 );
+ }
+ else if( attack2 )
+ {
+ PM_ForceLegsAnim( NSPA_ATTACK2 );
+ PM_StartWeaponAnim( WANIM_ATTACK2 );
+ }
+ else if( attack3 )
+ {
+ PM_ForceLegsAnim( NSPA_ATTACK3 );
+ PM_StartWeaponAnim( WANIM_ATTACK3 );
+ }
+ break;
}
pm->ps->torsoTimer = TIMER_ATTACK;
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index 361d857a..0802951c 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -782,6 +782,11 @@ typedef enum
WANIM_ATTACK1,
WANIM_ATTACK2,
WANIM_ATTACK3,
+ WANIM_ATTACK4,
+ WANIM_ATTACK5,
+ WANIM_ATTACK6,
+ WANIM_ATTACK7,
+ WANIM_ATTACK8,
MAX_WEAPON_ANIMATIONS
} weaponAnimNumber_t;