made cg_rq3_predictweapons even more like quake 2, and it's simpler

This commit is contained in:
Bryce Hutchings 2002-09-08 23:25:09 +00:00
parent c83698cb02
commit ac0cdb0b1c

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.90 2002/09/08 23:25:09 niceass
// made cg_rq3_predictweapons even more like quake 2, and it's simpler
//
// Revision 1.89 2002/09/04 00:16:17 makro // Revision 1.89 2002/09/04 00:16:17 makro
// Fixed 'unselectable grenade shown in the inventory if you switch weapons // Fixed 'unselectable grenade shown in the inventory if you switch weapons
// after pulling the pin' bug // after pulling the pin' bug
@ -172,9 +175,9 @@ static void PM_StartWeaponAnim(int anim)
} }
// NiceAss: Don't do client prediction of weapon animations // NiceAss: Don't do client prediction of weapon animations
if ( !pm->predict && (anim == WP_ANIM_FIRE || anim == WP_ANIM_IDLE || /*if ( !pm->predict && (anim == WP_ANIM_FIRE || anim == WP_ANIM_IDLE ||
anim == WP_ANIM_EXTRA1 || anim == WP_ANIM_THROWFIRE ) ) anim == WP_ANIM_EXTRA1 || anim == WP_ANIM_THROWFIRE ) )
return; return;*/
pm->ps->generic1 = ((pm->ps->generic1 & ANIM_TOGGLEBIT) ^ ANIM_TOGGLEBIT) | anim; pm->ps->generic1 = ((pm->ps->generic1 & ANIM_TOGGLEBIT) ^ ANIM_TOGGLEBIT) | anim;
} }
@ -186,9 +189,10 @@ static void PM_ContinueWeaponAnim(int anim)
} }
// NiceAss: Don't do client prediction of weapon animations // NiceAss: Don't do client prediction of weapon animations
/*
if ( !pm->predict && (anim == WP_ANIM_FIRE || anim == WP_ANIM_IDLE || if ( !pm->predict && (anim == WP_ANIM_FIRE || anim == WP_ANIM_IDLE ||
anim == WP_ANIM_EXTRA1 || anim == WP_ANIM_THROWFIRE ) ) anim == WP_ANIM_EXTRA1 || anim == WP_ANIM_THROWFIRE ) )
return; return;*/
PM_StartWeaponAnim(anim); PM_StartWeaponAnim(anim);
} }
@ -2180,8 +2184,8 @@ static void PM_Weapon(void)
//NiceAss: I added this for smooth M4 rise //NiceAss: I added this for smooth M4 rise
if (pm->ps->weaponstate == WEAPON_FIRING && pm->ps->ammo[pm->ps->weapon] && if (pm->ps->weaponstate == WEAPON_FIRING && pm->ps->ammo[pm->ps->weapon] &&
pm->ps->weapon == WP_M4 && !pm->ps->stats[STAT_BURST] && pm->ps->weapon == WP_M4 && !pm->ps->stats[STAT_BURST] &&
!(pm->ps->persistant[PERS_WEAPONMODES] & RQ3_M4MODE) && !(pm->ps->persistant[PERS_WEAPONMODES] & RQ3_M4MODE) /*&&
pm->predict ) { pm->predict*/ ) {
pm->ps->delta_angles[0] -= ANGLE2SHORT(0.13); pm->ps->delta_angles[0] -= ANGLE2SHORT(0.13);
} }
@ -2209,7 +2213,7 @@ static void PM_Weapon(void)
if (pm->ps->weapon == WP_GRENADE && pm->ps->weaponstate == WEAPON_COCKED) { if (pm->ps->weapon == WP_GRENADE && pm->ps->weaponstate == WEAPON_COCKED) {
pm->ps->weaponstate = WEAPON_FIRING; pm->ps->weaponstate = WEAPON_FIRING;
pm->cmd.buttons &= ~BUTTON_ATTACK; pm->cmd.buttons &= ~BUTTON_ATTACK;
if (pm->predict) //if (pm->predict)
PM_AddEvent2(EV_FIRE_WEAPON, RQ3_WPMOD_GRENADEDROP); PM_AddEvent2(EV_FIRE_WEAPON, RQ3_WPMOD_GRENADEDROP);
pm->ps->ammo[WP_GRENADE]--; pm->ps->ammo[WP_GRENADE]--;
//Makro - if this is the last grenade, remove the weapon from the inventory //Makro - if this is the last grenade, remove the weapon from the inventory
@ -2466,7 +2470,7 @@ static void PM_Weapon(void)
// fire weapon // fire weapon
// NiceAss: Check to see if this is game or cgame // NiceAss: Check to see if this is game or cgame
if (pm->predict) { //if (pm->predict) {
//Elder: check for silencer //Elder: check for silencer
if (bg_itemlist[pm->ps->stats[STAT_HOLDABLE_ITEM]].giTag == HI_SILENCER && if (bg_itemlist[pm->ps->stats[STAT_HOLDABLE_ITEM]].giTag == HI_SILENCER &&
(pm->ps->weapon == WP_PISTOL || pm->ps->weapon == WP_MP5 || pm->ps->weapon == WP_SSG3000)) { (pm->ps->weapon == WP_PISTOL || pm->ps->weapon == WP_MP5 || pm->ps->weapon == WP_SSG3000)) {
@ -2477,7 +2481,7 @@ static void PM_Weapon(void)
PM_AddEvent2(EV_FIRE_WEAPON, RQ3_WPMOD_KNIFENOMARK); PM_AddEvent2(EV_FIRE_WEAPON, RQ3_WPMOD_KNIFENOMARK);
} else } else
PM_AddEvent(EV_FIRE_WEAPON); PM_AddEvent(EV_FIRE_WEAPON);
} //}
switch (pm->ps->weapon) { switch (pm->ps->weapon) {
default: default:
@ -2965,8 +2969,10 @@ void PmoveSingle(pmove_t * pmove)
PM_SetWaterLevel(); PM_SetWaterLevel();
// weapons // weapons
PM_Reload(); if (pm->predict) {
PM_Weapon(); PM_Reload();
PM_Weapon();
}
// torso animation // torso animation
PM_TorsoAnimation(); PM_TorsoAnimation();