From 6a09f0e72c4c42392ee644745156358cbb41f7d0 Mon Sep 17 00:00:00 2001 From: Anna Clemens Date: Tue, 11 Aug 2020 08:13:19 -0400 Subject: [PATCH] fix: update offsets for 5.3 --- Peeping Tom/PluginUI.cs | 4 ++-- Peeping Tom/TargetWatcher.cs | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Peeping Tom/PluginUI.cs b/Peeping Tom/PluginUI.cs index e3057e0..61862c2 100644 --- a/Peeping Tom/PluginUI.cs +++ b/Peeping Tom/PluginUI.cs @@ -311,14 +311,14 @@ namespace PeepingTom { if (this.plugin.Interface.ClientState.LocalPlayer != null) { 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); ImGui.Text($"Status: {status}"); } PlayerCharacter currentTarget = this.GetCurrentTarget(); 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); ImGui.Text($"Target status: {status}"); } diff --git a/Peeping Tom/TargetWatcher.cs b/Peeping Tom/TargetWatcher.cs index 621d718..1c1da49 100644 --- a/Peeping Tom/TargetWatcher.cs +++ b/Peeping Tom/TargetWatcher.cs @@ -146,24 +146,24 @@ namespace PeepingTom { return actors .Where(actor => actor.TargetActorID == player.ActorId && actor is PlayerCharacter) .Select(actor => actor as PlayerCharacter) - .Where(actor => this.plugin.Config.LogParty || !this.InParty(actor)) - .Where(actor => this.plugin.Config.LogAlliance || !this.InAlliance(actor)) - .Where(actor => this.plugin.Config.LogInCombat || !this.InCombat(actor)) + .Where(actor => this.plugin.Config.LogParty || !InParty(actor)) + .Where(actor => this.plugin.Config.LogAlliance || !InAlliance(actor)) + .Where(actor => this.plugin.Config.LogInCombat || !InCombat(actor)) .Where(actor => this.plugin.Config.LogSelf || actor.ActorId != player.ActorId) .Select(actor => new Targeter(actor)) .ToArray(); } - private byte GetStatus(Actor actor) { - IntPtr statusPtr = this.plugin.Interface.TargetModuleScanner.ResolveRelativeAddress(actor.Address, 0x1901); + private static byte GetStatus(Actor actor) { + IntPtr statusPtr = actor.Address + 0x1906; // updated 5.3 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() { if (!this.plugin.Config.PlaySoundOnTarget) {