mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-13 17:34:15 +01:00
cleanup and fix application issues
This commit is contained in:
parent
9cdd991fc2
commit
de7e9d7293
13 changed files with 338 additions and 298 deletions
|
|
@ -118,6 +118,18 @@ public sealed class GameObjectHandler : DisposableMediatorSubscriberBase
|
|||
}
|
||||
}
|
||||
|
||||
public void CompareNameAndThrow(string name)
|
||||
{
|
||||
if (!string.Equals(Name, name, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
throw new InvalidOperationException("Player name not equal to requested name, pointer invalid");
|
||||
}
|
||||
if (Address == IntPtr.Zero)
|
||||
{
|
||||
throw new InvalidOperationException("Player pointer is zero, pointer invalid");
|
||||
}
|
||||
}
|
||||
|
||||
public IntPtr CurrentAddress()
|
||||
{
|
||||
_dalamudUtil.EnsureIsOnFramework();
|
||||
|
|
@ -133,6 +145,7 @@ public sealed class GameObjectHandler : DisposableMediatorSubscriberBase
|
|||
{
|
||||
Address = IntPtr.Zero;
|
||||
DrawObjectAddress = IntPtr.Zero;
|
||||
_haltProcessing = false;
|
||||
}
|
||||
|
||||
public async Task<bool> IsBeingDrawnRunOnFrameworkAsync()
|
||||
|
|
@ -156,8 +169,6 @@ public sealed class GameObjectHandler : DisposableMediatorSubscriberBase
|
|||
|
||||
private unsafe void CheckAndUpdateObject()
|
||||
{
|
||||
if (_haltProcessing) return;
|
||||
|
||||
var prevAddr = Address;
|
||||
var prevDrawObj = DrawObjectAddress;
|
||||
|
||||
|
|
@ -172,6 +183,8 @@ public sealed class GameObjectHandler : DisposableMediatorSubscriberBase
|
|||
DrawObjectAddress = IntPtr.Zero;
|
||||
}
|
||||
|
||||
if (_haltProcessing) return;
|
||||
|
||||
bool drawObjDiff = DrawObjectAddress != prevDrawObj;
|
||||
bool addrDiff = Address != prevAddr;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue