fix: update offsets for 5.3

This commit is contained in:
Anna 2020-08-11 08:13:19 -04:00
parent 7945690c7a
commit 6a09f0e72c
Signed by: anna
GPG Key ID: 0B391D8F06FCD9E0
2 changed files with 10 additions and 10 deletions

View File

@ -311,14 +311,14 @@ namespace PeepingTom {
if (this.plugin.Interface.ClientState.LocalPlayer != null) { if (this.plugin.Interface.ClientState.LocalPlayer != null) {
PlayerCharacter player = this.plugin.Interface.ClientState.LocalPlayer; PlayerCharacter player = this.plugin.Interface.ClientState.LocalPlayer;
IntPtr statusPtr = this.plugin.Interface.TargetModuleScanner.ResolveRelativeAddress(player.Address, 0x1901); IntPtr statusPtr = this.plugin.Interface.TargetModuleScanner.ResolveRelativeAddress(player.Address, 0x1906);
byte status = Marshal.ReadByte(statusPtr); byte status = Marshal.ReadByte(statusPtr);
ImGui.Text($"Status: {status}"); ImGui.Text($"Status: {status}");
} }
PlayerCharacter currentTarget = this.GetCurrentTarget(); PlayerCharacter currentTarget = this.GetCurrentTarget();
if (currentTarget != null) { if (currentTarget != null) {
IntPtr statusPtr = this.plugin.Interface.TargetModuleScanner.ResolveRelativeAddress(currentTarget.Address, 0x1901); IntPtr statusPtr = this.plugin.Interface.TargetModuleScanner.ResolveRelativeAddress(currentTarget.Address, 0x1906);
byte status = Marshal.ReadByte(statusPtr); byte status = Marshal.ReadByte(statusPtr);
ImGui.Text($"Target status: {status}"); ImGui.Text($"Target status: {status}");
} }

View File

@ -146,24 +146,24 @@ namespace PeepingTom {
return actors return actors
.Where(actor => actor.TargetActorID == player.ActorId && actor is PlayerCharacter) .Where(actor => actor.TargetActorID == player.ActorId && actor is PlayerCharacter)
.Select(actor => actor as PlayerCharacter) .Select(actor => actor as PlayerCharacter)
.Where(actor => this.plugin.Config.LogParty || !this.InParty(actor)) .Where(actor => this.plugin.Config.LogParty || !InParty(actor))
.Where(actor => this.plugin.Config.LogAlliance || !this.InAlliance(actor)) .Where(actor => this.plugin.Config.LogAlliance || !InAlliance(actor))
.Where(actor => this.plugin.Config.LogInCombat || !this.InCombat(actor)) .Where(actor => this.plugin.Config.LogInCombat || !InCombat(actor))
.Where(actor => this.plugin.Config.LogSelf || actor.ActorId != player.ActorId) .Where(actor => this.plugin.Config.LogSelf || actor.ActorId != player.ActorId)
.Select(actor => new Targeter(actor)) .Select(actor => new Targeter(actor))
.ToArray(); .ToArray();
} }
private byte GetStatus(Actor actor) { private static byte GetStatus(Actor actor) {
IntPtr statusPtr = this.plugin.Interface.TargetModuleScanner.ResolveRelativeAddress(actor.Address, 0x1901); IntPtr statusPtr = actor.Address + 0x1906; // updated 5.3
return Marshal.ReadByte(statusPtr); return Marshal.ReadByte(statusPtr);
} }
private bool InCombat(Actor actor) => (this.GetStatus(actor) & 2) > 0; private static bool InCombat(Actor actor) => (GetStatus(actor) & 2) > 0;
private bool InParty(Actor actor) => (this.GetStatus(actor) & 16) > 0; private static bool InParty(Actor actor) => (GetStatus(actor) & 16) > 0;
private bool InAlliance(Actor actor) => (this.GetStatus(actor) & 32) > 0; private static bool InAlliance(Actor actor) => (GetStatus(actor) & 32) > 0;
private bool CanPlaySound() { private bool CanPlaySound() {
if (!this.plugin.Config.PlaySoundOnTarget) { if (!this.plugin.Config.PlaySoundOnTarget) {