Fix some crashes
This commit is contained in:
@@ -2476,7 +2476,11 @@ namespace Game.Achievements
|
||||
|
||||
public class CriteriaManager : Singleton<CriteriaManager>
|
||||
{
|
||||
CriteriaManager() { }
|
||||
CriteriaManager()
|
||||
{
|
||||
for (var i = 0; i < (int)CriteriaTypes.TotalTypes; ++i)
|
||||
_criteriasByAsset[i] = new MultiMap<uint, Criteria>();
|
||||
}
|
||||
|
||||
public void LoadCriteriaModifiersTree()
|
||||
{
|
||||
@@ -2639,6 +2643,30 @@ namespace Game.Achievements
|
||||
{
|
||||
++criterias;
|
||||
_criteriasByType.Add(criteriaEntry.Type, criteria);
|
||||
if (IsCriteriaTypeStoredByAsset(criteriaEntry.Type))
|
||||
{
|
||||
if (criteriaEntry.Type != CriteriaTypes.ExploreArea)
|
||||
_criteriasByAsset[(int)criteriaEntry.Type].Add(criteriaEntry.Asset, criteria);
|
||||
else
|
||||
{
|
||||
var worldOverlayEntry = CliDB.WorldMapOverlayStorage.LookupByKey(criteriaEntry.Asset);
|
||||
if (worldOverlayEntry == null)
|
||||
break;
|
||||
|
||||
for (byte j = 0; j < SharedConst.MaxWorldMapOverlayArea; ++j)
|
||||
{
|
||||
if (worldOverlayEntry.AreaID[j] != 0)
|
||||
{
|
||||
bool valid = true;
|
||||
for (byte i = 0; i < j; ++i)
|
||||
if (worldOverlayEntry.AreaID[j] == worldOverlayEntry.AreaID[i])
|
||||
valid = false;
|
||||
if (valid)
|
||||
_criteriasByAsset[(int)criteriaEntry.Type].Add(worldOverlayEntry.AreaID[j], criteria);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (criteria.FlagsCu.HasAnyFlag(CriteriaFlagsCu.Guild))
|
||||
|
||||
@@ -1472,11 +1472,11 @@ namespace Game
|
||||
owner.GetSession().SendAuctionClosedNotification(auction, 0.0f, false);
|
||||
|
||||
int itemIndex = 0;
|
||||
while (auction.Items.Count > itemIndex)
|
||||
while (itemIndex < auction.Items.Count)
|
||||
{
|
||||
MailDraft mail = new MailDraft(Global.AuctionHouseMgr.BuildItemAuctionMailSubject(AuctionMailType.Expired, auction), "");
|
||||
|
||||
for (int i = 0; i < SharedConst.MaxMailItems && auction.Items[itemIndex] != null; ++i, ++itemIndex)
|
||||
for (int i = 0; i < SharedConst.MaxMailItems && itemIndex < auction.Items.Count; ++i, ++itemIndex)
|
||||
mail.AddItem(auction.Items[itemIndex]);
|
||||
|
||||
mail.SendMailTo(trans, new MailReceiver(owner, auction.Owner), new MailSender(this), MailCheckMask.Copied, 0);
|
||||
@@ -1493,11 +1493,11 @@ namespace Game
|
||||
public void SendAuctionRemoved(AuctionPosting auction, Player owner, SQLTransaction trans)
|
||||
{
|
||||
int itemIndex = 0;
|
||||
while (auction.Items.Count > itemIndex)
|
||||
while (itemIndex < auction.Items.Count)
|
||||
{
|
||||
MailDraft draft = new MailDraft(Global.AuctionHouseMgr.BuildItemAuctionMailSubject(AuctionMailType.Cancelled, auction), "");
|
||||
|
||||
for (int i = 0; i < SharedConst.MaxMailItems && auction.Items[itemIndex] != null; ++i, ++itemIndex)
|
||||
for (int i = 0; i < SharedConst.MaxMailItems && itemIndex < auction.Items.Count; ++i, ++itemIndex)
|
||||
draft.AddItem(auction.Items[itemIndex]);
|
||||
|
||||
draft.SendMailTo(trans, owner, new MailSender(this), MailCheckMask.Copied);
|
||||
|
||||
@@ -34,7 +34,6 @@ namespace Game.Movement
|
||||
public MotionMaster(Unit me)
|
||||
{
|
||||
_owner = me;
|
||||
_expireList = null;
|
||||
_top = -1;
|
||||
_cleanFlag = MMCleanFlag.None;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user