Fix missing melee icon in JKO

and don't draw crosshair when melee active
This commit is contained in:
Simon 2023-06-01 23:04:31 +01:00
parent 134cc9835f
commit 72fc1b9b83
5 changed files with 8 additions and 0 deletions

View file

@ -3008,6 +3008,7 @@ static void CG_DrawCrosshair3D(int type) // 0 - force, 1 - weapons
if ( type == 1 && (cg.snap->ps.weapon == WP_NONE || if ( type == 1 && (cg.snap->ps.weapon == WP_NONE ||
cg.snap->ps.weapon == WP_SABER || cg.snap->ps.weapon == WP_SABER ||
cg.snap->ps.weapon == WP_MELEE ||
cg.snap->ps.weapon == WP_THERMAL )) cg.snap->ps.weapon == WP_THERMAL ))
{ {
return; return;

View file

@ -1894,6 +1894,7 @@ static void CG_DrawCrosshair3D(int type) // 0 - force, 1 - weapons
} }
if ( type == 1 && (cg.snap->ps.weapon == WP_NONE || if ( type == 1 && (cg.snap->ps.weapon == WP_NONE ||
cg.snap->ps.weapon == WP_MELEE ||
cg.snap->ps.weapon == WP_SABER || cg.snap->ps.weapon == WP_SABER ||
cg.snap->ps.weapon == WP_STUN_BATON || cg.snap->ps.weapon == WP_STUN_BATON ||
cg.snap->ps.weapon == WP_THERMAL )) cg.snap->ps.weapon == WP_THERMAL ))

View file

@ -116,6 +116,12 @@ void CG_RegisterWeapon( int weaponNum ) {
weaponInfo->weaponMidpoint[i] = mins[i] + 0.5 * ( maxs[i] - mins[i] ); weaponInfo->weaponMidpoint[i] = mins[i] + 0.5 * ( maxs[i] - mins[i] );
} }
//Bit of a hack - default weapons.dat on JK2 is missing the melee icon!
if (weaponNum == WP_MELEE)
{
strcpy((char *)weaponData[weaponNum].weaponIcon, "gfx/hud/w_icon_melee");
}
// setup the shader we will use for the icon // setup the shader we will use for the icon
if (weaponData[weaponNum].weaponIcon[0]) if (weaponData[weaponNum].weaponIcon[0])
{ {

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB