Opened 9 years ago

Closed 6 years ago

Last modified 5 years ago

#27 closed defect (fixed)

You cannot buy knives after you bought a scope.

Reported by: khpe Owned by: sg_tequila
Priority: minor Milestone: Smokin' Guns 1.2
Component: Client GUI and Experience Version: 1.1b4
Keywords: Cc:

Description

The buy menu won't let you buy knives (buy-5-6) after you bought a scope (buy-5-2). The menu entry for knives is white (thus it should be selectable). Moreover, if you buy a scope, you keep any knives you bought or collected earlier and you can still collect additional knives.

Attachments (1)

fix_trac_27.patch (1.7 KB) - added by ilag 6 years ago.
Potential bugfix patch. Allows purchasing of knives when a scope is owned.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 6 years ago by Téquila

Milestone: Smokin' Guns 1.1Smokin' Guns 1.2

Changed 6 years ago by ilag

Attachment: fix_trac_27.patch added

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

comment:2 Changed 6 years ago by ilag

Attaching Patch. Based on synchro's branch, but should apply to master as well.

The problem was caused by an oversight in the use of ENUMs. WP_KNIFE and PW_SCOPE have the same value of 1, selecting the knife to purchase when you have a scope in your inventory caused this if statement to trigger:
if(item->giTag == PW_SCOPE && cg.snap->ps.powerups[PW_SCOPE]) return;

The solution was to encapsulate that if as well as the other two into an if statement. More specifically, the else branch of if(item->giType == IT_WEAPON).

Testing shows no signs of any issues. All items remain purchasable, and it was possible to purchase knives after purchasing a scope.

Included in the patch is a fix to what is most likely a non-issue relating to text colors. Since nobody noticed it before, it must not have been a problem, but at least now it matches everything correctly.

comment:3 Changed 6 years ago by sg_tequila

Owner: set to sg_tequila
Resolution: fixed
Status: newclosed

In 669/SourceForge-svn:

Fix #27, can't buy knives after scope, thanks to new contributor iLag

comment:4 Changed 5 years ago by Tequila <tequila@…

In 5f9fcbd5eeae6b0922a4d1b0f095378bd9755ecc/SmokinGuns:

Fix #27, can't buy knives after scope, thanks to new contributor iLag

(Merged again)

Note: See TracTickets for help on using tickets.