fixed problems with wrong weapon id ( enfield & fg42 )

This commit is contained in:
Lukasz Wlasinksi 2005-07-24 11:07:49 +00:00
parent 79268c5316
commit 76505f172a

View File

@ -81,6 +81,7 @@ weapon_t weaponData[] = {
/* Function will select correct id */ /* Function will select correct id */
int get_weaponid(CPlayer* pPlayer){ int get_weaponid(CPlayer* pPlayer){
int weapon = pPlayer->current; int weapon = pPlayer->current;
const char *sz;
switch(weapon) { switch(weapon) {
case 1: if ( g_map.detect_allies_country ) weapon = 37; break; case 1: if ( g_map.detect_allies_country ) weapon = 37; break;
case 5: if ( pPlayer->pEdict->v.button&IN_ATTACK2 ) weapon = 38; break; case 5: if ( pPlayer->pEdict->v.button&IN_ATTACK2 ) weapon = 38; break;
@ -89,20 +90,25 @@ int get_weaponid(CPlayer* pPlayer){
if ( g_map.detect_allies_paras ) weapon = 33; if ( g_map.detect_allies_paras ) weapon = 33;
break; break;
case 23: case 23:
if ( pPlayer->pEdict->v.weaponmodel ) sz = STRING(pPlayer->pEdict->v.weaponmodel);
pPlayer->wpnModel = pPlayer->pEdict->v.weaponmodel; if ( sz[13] == 's' )
if ( !( pPlayer->wpnModel&(1<<3) ) )
weapon = 32; weapon = 32;
break; break;
case 24: if ( pPlayer->pEdict->v.button&IN_ATTACK2 ) weapon = 41; break; case 24: if ( pPlayer->pEdict->v.button&IN_ATTACK2 ) weapon = 41; break;
case 25: case 25:
if ( pPlayer->pEdict->v.weaponmodel ) sz = STRING(pPlayer->pEdict->v.weaponmodel);
pPlayer->wpnModel = pPlayer->pEdict->v.weaponmodel; if ( sz[16] == 's' )
if ( pPlayer->wpnModel&(1<<3) )
weapon = 35; weapon = 35;
else if ( pPlayer->pEdict->v.button&IN_ATTACK2 ) else if ( pPlayer->pEdict->v.button&IN_ATTACK2 )
weapon = 39; weapon = 39;
break; break;
case 15:
weapon = 14;
break;
case 16:
if ( g_map.detect_allies_country ) weapon = 36;
else weapon = 13;
break;
} }
return weapon; return weapon;
} }