mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
Remove ReadProcessMemory call
New performance metric for the uncached case: About `55ms`
This commit is contained in:
parent
ebbd79274b
commit
32aa32d64a
1 changed files with 1 additions and 8 deletions
|
|
@ -73,14 +73,7 @@ namespace Dalamud.Game.ClientState.Actors {
|
|||
private Actor ReadActorFromMemory(IntPtr offset)
|
||||
{
|
||||
try {
|
||||
// FIXME: hack workaround for trying to access the player on logout, after the main object has been deleted
|
||||
if (!ReadProcessMemory(Process.GetCurrentProcess().Handle, offset, actorMem, actorMemSize, out _))
|
||||
{
|
||||
Log.Debug("ActorTable - ReadProcessMemory failed: likely player deletion during logout");
|
||||
return null;
|
||||
}
|
||||
|
||||
var actorStruct = Marshal.PtrToStructure<Structs.Actor>(actorMem);
|
||||
var actorStruct = Marshal.PtrToStructure<Structs.Actor>(offset);
|
||||
|
||||
switch (actorStruct.ObjectKind) {
|
||||
case ObjectKind.Player: return new PlayerCharacter(offset, actorStruct, this.dalamud);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue