#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)
Change History (5)
comment:1 Changed 12 years ago by
Milestone: | Smokin' Guns 1.1 → Smokin' Guns 1.2 |
---|
Changed 12 years ago by
Attachment: | fix_trac_27.patch added |
---|
comment:2 Changed 12 years ago by
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 12 years ago by
Owner: | set to sg_tequila |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Potential bugfix patch. Allows purchasing of knives when a scope is owned.