[11769] Fixed auction ordering functions assert fails.

This fix problem when by same order case left/right auction greater each other
in same time. This possible in old code because selection way compare for
case dependent only from one from compared auction so it can be true/false
for left/right.
This commit is contained in:
VladimirMangos 2011-08-07 00:19:29 +04:00
parent 3a85c36907
commit 5310a7a0ea
2 changed files with 19 additions and 25 deletions

View file

@ -668,7 +668,7 @@ int AuctionEntry::CompareAuctionEntry(uint32 column, const AuctionEntry *auc, Pl
break;
}
case 2: // buyoutthenbid = 2
if (buyout)
if (buyout != auc->buyout)
{
if (buyout < auc->buyout)
return -1;
@ -716,18 +716,15 @@ int AuctionEntry::CompareAuctionEntry(uint32 column, const AuctionEntry *auc, Pl
return wname1.compare(wname2);
}
case 6: // minbidbuyout = 6
if (bid)
{
uint32 bid1 = bid ? bid : startbid;
uint32 bid2 = auc->bid ? auc->bid : auc->startbid;
if (bid1 != bid2)
{
if (bid < auc->bid)
if (bid1 < bid2)
return -1;
else if (bid > auc->bid)
return +1;
}
else if (startbid)
{
if (startbid < auc->startbid)
return -1;
else if (startbid > auc->startbid)
else if (bid1 > bid2)
return +1;
}
else
@ -737,25 +734,22 @@ int AuctionEntry::CompareAuctionEntry(uint32 column, const AuctionEntry *auc, Pl
else if (buyout > auc->buyout)
return +1;
}
break;
}
case 7: // seller = 7
return ownerName.compare(auc->ownerName);
case 8: // bid = 8
if (bid)
{
if (bid < auc->bid)
return -1;
else if (bid > auc->bid)
{
uint32 bid1 = bid ? bid : startbid;
uint32 bid2 = auc->bid ? auc->bid : auc->startbid;
if (bid1 < bid2)
return -1;
else if (bid1 > bid2)
return +1;
}
else
{
if (startbid < auc->startbid)
return -1;
else if (startbid > auc->startbid)
return +1;
}
break;
}
case 9: // quantity = 9
{
if (itemCount < auc->itemCount)

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11768"
#define REVISION_NR "11769"
#endif // __REVISION_NR_H__