make application of character data blocking

This commit is contained in:
rootdarkarchon
2023-02-17 00:38:42 +01:00
parent 6457a1fe9a
commit 0cf12d57ef
9 changed files with 178 additions and 116 deletions

View File

@@ -71,6 +71,20 @@ public class GameObjectHandler : MediatorSubscriberBase
Mediator.Subscribe<ZoneSwitchStartMessage>(this, (_) => ZoneSwitchStart());
Mediator.Subscribe<FrameworkUpdateMessage>(this, (_) => FrameworkUpdate());
});
Mediator.Subscribe<PenumbraStartRedrawMessage>(this, (msg) =>
{
if (((PenumbraStartRedrawMessage)msg).Address == Address)
{
Mediator.Unsubscribe<FrameworkUpdateMessage>(this);
}
});
Mediator.Subscribe<PenumbraEndRedrawMessage>(this, (msg) =>
{
if (((PenumbraEndRedrawMessage)msg).Address == Address)
{
Mediator.Subscribe<FrameworkUpdateMessage>(this, (_) => FrameworkUpdate());
}
});
}
private void FrameworkUpdate()
@@ -120,7 +134,7 @@ public class GameObjectHandler : MediatorSubscriberBase
public byte? VisorWeaponState { get; set; }
private bool _doNotSendUpdate;
public unsafe bool CheckAndUpdateObject()
private unsafe bool CheckAndUpdateObject()
{
var curPtr = CurrentAddress;
if (curPtr != IntPtr.Zero && (IntPtr)((Character*)curPtr)->GameObject.DrawObject != IntPtr.Zero)
@@ -226,7 +240,6 @@ public class GameObjectHandler : MediatorSubscriberBase
_doNotSendUpdate = true;
}
HatState = newHatState;
hasChanges = true;
}
newWeaponOrVisorState &= 0b1101; // ignore drawing weapon
@@ -239,7 +252,6 @@ public class GameObjectHandler : MediatorSubscriberBase
_doNotSendUpdate = true;
}
VisorWeaponState = newWeaponOrVisorState;
hasChanges = true;
}
return hasChanges;