Jeck - Fix to WSrcDeck's card counting, so it correctly handles negative numbers (removing cards).

This commit is contained in:
wagic.jeck
2010-02-28 22:55:06 +00:00
parent 706ebca249
commit 4159aad221
2 changed files with 8 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mtg", "template.vcproj", "{53024371-2293-4D40-8ECF-FCB470B50DA1}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JGE", "..\..\JGE\JGE.vcproj", "{89159C26-2282-404A-A194-103B0A49DF7B}"
@@ -8,18 +8,23 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
HQ Debug|Win32 = HQ Debug|Win32
Profile|Win32 = Profile|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{53024371-2293-4D40-8ECF-FCB470B50DA1}.Debug|Win32.ActiveCfg = Debug|Win32
{53024371-2293-4D40-8ECF-FCB470B50DA1}.Debug|Win32.Build.0 = Debug|Win32
{53024371-2293-4D40-8ECF-FCB470B50DA1}.HQ Debug|Win32.ActiveCfg = HQ Debug|Win32
{53024371-2293-4D40-8ECF-FCB470B50DA1}.HQ Debug|Win32.Build.0 = HQ Debug|Win32
{53024371-2293-4D40-8ECF-FCB470B50DA1}.Profile|Win32.ActiveCfg = Profile|Win32
{53024371-2293-4D40-8ECF-FCB470B50DA1}.Profile|Win32.Build.0 = Profile|Win32
{53024371-2293-4D40-8ECF-FCB470B50DA1}.Release|Win32.ActiveCfg = Release|Win32
{53024371-2293-4D40-8ECF-FCB470B50DA1}.Release|Win32.Build.0 = Release|Win32
{89159C26-2282-404A-A194-103B0A49DF7B}.Debug|Win32.ActiveCfg = Debug|Win32
{89159C26-2282-404A-A194-103B0A49DF7B}.Debug|Win32.Build.0 = Debug|Win32
{89159C26-2282-404A-A194-103B0A49DF7B}.HQ Debug|Win32.ActiveCfg = HQ Debug|Win32
{89159C26-2282-404A-A194-103B0A49DF7B}.HQ Debug|Win32.Build.0 = HQ Debug|Win32
{89159C26-2282-404A-A194-103B0A49DF7B}.Profile|Win32.ActiveCfg = Profile|Win32
{89159C26-2282-404A-A194-103B0A49DF7B}.Profile|Win32.Build.0 = Profile|Win32
{89159C26-2282-404A-A194-103B0A49DF7B}.Release|Win32.ActiveCfg = Release|Win32

View File

@@ -409,10 +409,10 @@ void WSrcDeck::addCount(MTGCard * c, int qty){
if(!c || !c->data) return;
if(matchesFilters(c)){
counts[FILTERED_COPIES]+=qty;
counts[FILTERED_UNIQUE]++;
counts[FILTERED_UNIQUE]+=qty;
}
counts[UNFILTERED_COPIES] += qty;
counts[UNFILTERED_UNIQUE]++;
counts[UNFILTERED_UNIQUE]+=qty;
for(int i=Constants::MTG_COLOR_ARTIFACT;i<=Constants::MTG_COLOR_LAND;i++)
if (c->data->hasColor(i)) counts[i]+= qty;
if(counts[UNFILTERED_MIN_COPIES] < 0 || qty < counts[UNFILTERED_MIN_COPIES]) counts[UNFILTERED_MIN_COPIES] = qty;