mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-31 21:03:43 +01:00
fix: use -1 as ProcessHandle for ActorTable read hack
This commit is contained in:
parent
e1d82d8c72
commit
162ba3f894
1 changed files with 2 additions and 2 deletions
|
|
@ -43,7 +43,7 @@ namespace Dalamud.Game.ClientState.Actors {
|
|||
|
||||
private static readonly int ActorMemSize = Marshal.SizeOf(typeof(Structs.Actor));
|
||||
private IntPtr actorMem = Marshal.AllocHGlobal(ActorMemSize);
|
||||
private Process currentProcess = Process.GetCurrentProcess();
|
||||
private IntPtr currentProcessHandle = new IntPtr(-1);
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ namespace Dalamud.Game.ClientState.Actors {
|
|||
{
|
||||
try {
|
||||
// FIXME: hack workaround for trying to access the player on logout, after the main object has been deleted
|
||||
if (!ReadProcessMemory(this.currentProcess.Handle, offset, this.actorMem, ActorMemSize, out _))
|
||||
if (!ReadProcessMemory(this.currentProcessHandle, offset, this.actorMem, ActorMemSize, out _))
|
||||
{
|
||||
Log.Debug("ActorTable - ReadProcessMemory failed: likely player deletion during logout");
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue