Misc fixes

This commit is contained in:
hondacrx
2022-08-04 18:06:54 -04:00
parent 4fea5e1b1e
commit a164362caa
3 changed files with 11 additions and 9 deletions
+1 -1
View File
@@ -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;
+9 -7
View File
@@ -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);
+1 -1
View File
@@ -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; }