ioquake / ioq3

The ioquake3 community effort to continue supporting/developing id's Quake III Arena
https://ioquake3.org/
GNU General Public License v2.0
2.42k stars 529 forks source link

Fix lightning gun weapon number zeroed when sending weapon info to EV_MISSILE_MISS event #695

Open LegendaryGuard opened 1 month ago

LegendaryGuard commented 1 month ago

This forgotten detail from id Software has been unfixed for years and years. So, that means lightning gun sounds and effects don't play while the weapon number is always 0. That can be reproduced and debugged writing these lines on cgame/cg_weapons.c in line ~1923:

    Com_Printf( "what weapon I am holding? answer: %d\n", weapon );
    Com_Printf( "WP_GAUNTLET: %d\n", WP_GAUNTLET );
    Com_Printf( "WP_MACHINEGUN: %d\n", WP_MACHINEGUN );
    Com_Printf( "WP_SHOTGUN: %d\n", WP_SHOTGUN );
    Com_Printf( "WP_GRENADE_LAUNCHER: %d\n", WP_GRENADE_LAUNCHER );
    Com_Printf( "WP_ROCKET_LAUNCHER: %d\n", WP_ROCKET_LAUNCHER );
    Com_Printf( "WP_LIGHTNING: %d\n", WP_LIGHTNING );
    Com_Printf( "WP_RAILGUN: %d\n", WP_RAILGUN );
    Com_Printf( "WP_PLASMAGUN: %d\n", WP_PLASMAGUN );
    Com_Printf( "WP_BFG: %d\n", WP_BFG );

Compile, run the game, get the lightning gun weapon, use it and shoot no matter where, it will print the log in the console.

That's what happens in the console log: