Core/Instances: Fixed assertion failure with instance id based lockouts
Port From (https://github.com/TrinityCore/TrinityCore/commit/7dc25889c6f8785a8d8a98c990e2421ca9b2a0c7)
This commit is contained in:
@@ -310,8 +310,9 @@ namespace Game.Maps
|
|||||||
{
|
{
|
||||||
var sharedData = _instanceLockDataById.LookupByKey(updateEvent.InstanceId);
|
var sharedData = _instanceLockDataById.LookupByKey(updateEvent.InstanceId);
|
||||||
Cypher.Assert(sharedData != null);
|
Cypher.Assert(sharedData != null);
|
||||||
Cypher.Assert(sharedData.InstanceId == updateEvent.InstanceId);
|
Cypher.Assert(sharedData.InstanceId == 0 || sharedData.InstanceId == updateEvent.InstanceId);
|
||||||
sharedData.Data = updateEvent.NewData;
|
sharedData.Data = updateEvent.NewData;
|
||||||
|
sharedData.InstanceId = updateEvent.InstanceId;
|
||||||
if (updateEvent.CompletedEncounter != null)
|
if (updateEvent.CompletedEncounter != null)
|
||||||
{
|
{
|
||||||
sharedData.CompletedEncountersMask |= 1u << updateEvent.CompletedEncounter.Bit;
|
sharedData.CompletedEncountersMask |= 1u << updateEvent.CompletedEncounter.Bit;
|
||||||
@@ -519,7 +520,7 @@ namespace Game.Maps
|
|||||||
|
|
||||||
public uint GetInstanceId() { return _instanceId; }
|
public uint GetInstanceId() { return _instanceId; }
|
||||||
|
|
||||||
public virtual void SetInstanceId(uint instanceId) { _instanceId = instanceId; }
|
public void SetInstanceId(uint instanceId) { _instanceId = instanceId; }
|
||||||
|
|
||||||
public DateTime GetExpiryTime() { return _expiryTime; }
|
public DateTime GetExpiryTime() { return _expiryTime; }
|
||||||
|
|
||||||
@@ -552,7 +553,6 @@ namespace Game.Maps
|
|||||||
|
|
||||||
class SharedInstanceLock : InstanceLock
|
class SharedInstanceLock : InstanceLock
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Instance id based locks have two states
|
/// Instance id based locks have two states
|
||||||
/// One shared by everyone, which is the real state used by instance
|
/// One shared by everyone, which is the real state used by instance
|
||||||
@@ -565,12 +565,6 @@ namespace Game.Maps
|
|||||||
_sharedData = sharedData;
|
_sharedData = sharedData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SetInstanceId(uint instanceId)
|
|
||||||
{
|
|
||||||
base.SetInstanceId(instanceId);
|
|
||||||
_sharedData.InstanceId = instanceId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override InstanceLockData GetInstanceInitializationData() { return _sharedData; }
|
public override InstanceLockData GetInstanceInitializationData() { return _sharedData; }
|
||||||
|
|
||||||
public SharedInstanceLockData GetSharedData() { return _sharedData; }
|
public SharedInstanceLockData GetSharedData() { return _sharedData; }
|
||||||
|
|||||||
Reference in New Issue
Block a user