Ticket #27: fix_trac_27.patch

File fix_trac_27.patch, 1.7 KB (added by ilag, 11 years ago)

Potential bugfix patch. Allows purchasing of knives when a scope is owned.

  • code/cgame/cg_draw.c

    diff --git a/code/cgame/cg_draw.c b/code/cgame/cg_draw.c
    index b103544..649c254 100644
    a b static void CG_SetupItemMenu(void){ 
    37993799                        (item->giTag == PW_BELT && cg.snap->ps.powerups[PW_BELT] && item->giType == IT_POWERUP) ||
    38003800                        (item->giType == IT_ARMOR && cg.snap->ps.stats[STAT_ARMOR])||
    38013801                        (item->giType == IT_POWERUP && item->giTag == PW_SCOPE && cg.snap->ps.powerups[PW_SCOPE]) ||
    3802                         (((item->giTag == WP_DYNAMITE || item->giTag == WP_KNIFE || WP_MOLOTOV) && item->giType == IT_WEAPON) &&
     3802                        (((item->giTag == WP_DYNAMITE || item->giTag == WP_KNIFE || item->giTag == WP_MOLOTOV) && item->giType == IT_WEAPON) &&
    38033803                        cg.snap->ps.ammo[item->giTag] >= bg_weaponlist[item->giTag].maxAmmo)))
    38043804                {
    38053805                        menu_items[count].inventory = qtrue;
    static void CG_DrawBuyMenu( void ) { 
    41354135                                        && item->weapon_sort != WS_MISC){
    41364136                                        return;
    41374137                                }
    4138                         }
    4139                         if(item->giTag == PW_BELT && cg.snap->ps.powerups[PW_BELT])
    4140                                 return;
    4141                         if(item->giType == IT_ARMOR && cg.snap->ps.stats[STAT_ARMOR])
    4142                                 return;
    4143                         if(item->giTag == PW_SCOPE && cg.snap->ps.powerups[PW_SCOPE])
    4144                                 return;
    4145 
     4138                        } else {
     4139                if(item->giTag == PW_BELT && cg.snap->ps.powerups[PW_BELT])
     4140                    return;
     4141                if(item->giType == IT_ARMOR && cg.snap->ps.stats[STAT_ARMOR])
     4142                    return;
     4143                if(item->giTag == PW_SCOPE && cg.snap->ps.powerups[PW_SCOPE])
     4144                    return;
     4145            }
    41464146                        trap_SendConsoleCommand(va("cg_buy %s\n", item->classname));
    41474147//                      trap_S_StartSound(NULL, cg.snap->ps.clientNum, CHAN_WEAPON, cgs.media.buySound);
    41484148                        cg.oldbutton = qtrue;