mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 19:57:23 +01:00
fixes rare race issue with data building
This commit is contained in:
parent
8ba495994b
commit
014172ea3c
1 changed files with 9 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ public sealed class GameObjectHandler : DisposableMediatorSubscriberBase
|
|||
private Task? _delayedZoningTask;
|
||||
private bool _haltProcessing = false;
|
||||
private bool _ignoreSendAfterRedraw = false;
|
||||
private int _ptrNullCounter = 0;
|
||||
private CancellationTokenSource _zoningCts = new();
|
||||
|
||||
public GameObjectHandler(ILogger<GameObjectHandler> logger, PerformanceCollectorService performanceCollector,
|
||||
|
|
@ -175,6 +176,7 @@ public sealed class GameObjectHandler : DisposableMediatorSubscriberBase
|
|||
Address = _getAddress();
|
||||
if (Address != IntPtr.Zero)
|
||||
{
|
||||
_ptrNullCounter = 0;
|
||||
var drawObjAddr = (IntPtr)((FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject*)Address)->DrawObject;
|
||||
DrawObjectAddress = drawObjAddr;
|
||||
}
|
||||
|
|
@ -297,6 +299,13 @@ public sealed class GameObjectHandler : DisposableMediatorSubscriberBase
|
|||
var curPtr = _getAddress();
|
||||
Logger.LogTrace("[{this}] IsBeingDrawn, CurPtr: {ptr}", this, curPtr.ToString("X"));
|
||||
|
||||
if (curPtr == IntPtr.Zero && _ptrNullCounter < 2)
|
||||
{
|
||||
Logger.LogTrace("[{this}] IsBeingDrawn, CurPtr is ZERO, counter is {cnt}", this, _ptrNullCounter);
|
||||
_ptrNullCounter++;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (curPtr == IntPtr.Zero)
|
||||
{
|
||||
Logger.LogTrace("[{this}] IsBeingDrawn, CurPtr is ZERO, returning", this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue