WEAPON_MP5: Randomize between the three firing animations the _right_ way

This commit is contained in:
Marco Cawthorne 2022-05-01 19:47:05 -07:00
parent 82557ee0b0
commit 78eb9a04b2
Signed by: eukara
GPG Key ID: C196CD8BA993248A
2 changed files with 9 additions and 5 deletions

View File

@ -30,7 +30,7 @@ player::Physics_Jump(void)
} else {
/* Half-Life: Longjump module */
if (flags & FL_CROUCHING && g_items & 0x00008000i) {
makevectors(v_angle);
makevectors([0, v_angle[1], 0]);
velocity = v_forward * 512;
velocity[2] += 100;
}

View File

@ -171,13 +171,17 @@ w_mp5_primary(player pl)
pl.mp5_mag--;
/* Actual firing */
int r = (float)input_sequence % 3;
if (r == 0) {
int r = floor(pseudorandom() * 3.0f);
switch (r) {
case 1:
Weapons_ViewAnimation(pl, MP5_FIRE1);
} else if (r = 2) {
break;
case 2:
Weapons_ViewAnimation(pl, MP5_FIRE2);
} else {
break;
default:
Weapons_ViewAnimation(pl, MP5_FIRE3);
break;
}
Weapons_ViewPunchAngle(pl, [-2,0,0]);