Misc fixes
This commit is contained in:
@@ -465,7 +465,7 @@ namespace Game.Combat
|
||||
oldVictimRef = null;
|
||||
|
||||
// in 99% of cases - we won't need to actually look at anything beyond the first element
|
||||
ThreatReference highest = _sortedThreatList.Max();
|
||||
ThreatReference highest = _sortedThreatList.First();
|
||||
// if the highest reference is offline, the entire list is offline, and we indicate this
|
||||
if (!highest.IsAvailable())
|
||||
return null;
|
||||
|
||||
@@ -3392,12 +3392,12 @@ namespace Game.Entities
|
||||
// this may be a dead loop if some events on aura remove will continiously apply aura on remove
|
||||
// we want to have all auras removed, so use your brain when linking events
|
||||
for (int counter = 0; !m_appliedAuras.Empty() || !m_ownedAuras.Empty(); counter++)
|
||||
{
|
||||
while (!m_appliedAuras.Empty())
|
||||
_UnapplyAura(m_appliedAuras.First(), AuraRemoveMode.Default);
|
||||
{
|
||||
foreach (var aurAppIter in GetAppliedAuras())
|
||||
_UnapplyAura(aurAppIter, AuraRemoveMode.Default);
|
||||
|
||||
while (!m_ownedAuras.Empty())
|
||||
RemoveOwnedAura(m_ownedAuras.First());
|
||||
foreach (var aurIter in GetOwnedAuras())
|
||||
RemoveOwnedAura(aurIter);
|
||||
|
||||
const int maxIteration = 50;
|
||||
// give this loop a few tries, if there are still auras then log as much information as possible
|
||||
@@ -3608,6 +3608,10 @@ namespace Game.Entities
|
||||
// removes aura application from lists and unapplies effects
|
||||
public void _UnapplyAura(KeyValuePair<uint, AuraApplication> pair, AuraRemoveMode removeMode)
|
||||
{
|
||||
//Check if aura was already removed, if so just return.
|
||||
if (!m_appliedAuras.Remove(pair))
|
||||
return;
|
||||
|
||||
AuraApplication aurApp = pair.Value;
|
||||
Cypher.Assert(aurApp != null);
|
||||
Cypher.Assert(!aurApp.HasRemoveMode());
|
||||
@@ -3624,8 +3628,6 @@ namespace Game.Entities
|
||||
|
||||
Unit caster = aura.GetCaster();
|
||||
|
||||
m_appliedAuras.Remove(pair);
|
||||
|
||||
if (aura.GetSpellInfo().HasAnyAuraInterruptFlag())
|
||||
{
|
||||
m_interruptableAuras.Remove(aurApp);
|
||||
|
||||
@@ -278,7 +278,7 @@ namespace Game
|
||||
if (mmap == null)
|
||||
return null;
|
||||
|
||||
return mmap.navMeshQueries[instanceId];
|
||||
return mmap.navMeshQueries.LookupByKey(instanceId);
|
||||
}
|
||||
|
||||
public uint GetLoadedTilesCount() { return loadedTiles; }
|
||||
|
||||
Reference in New Issue
Block a user