From a33a97c1ce1cad5f951126622492d9704a0980c2 Mon Sep 17 00:00:00 2001 From: UltiNaruto Date: Sat, 14 Aug 2021 23:07:19 +0200 Subject: [PATCH] Version 2.4 Fixed Corruption tracker not showing Energy Cells --- MPItemTracker2/Forms/MainForm.Designer.cs | 2 +- MPItemTracker2/MPItemTracker2.csproj | 2 +- MPItemTracker2/Wrapper/Corruption/Corruption.cs | 8 ++++++-- MPItemTracker2/Wrapper/Prime/MPT_MP1_NTSC_J.cs | 2 +- MPItemTracker2/Wrapper/Prime/MPT_MP1_NTSC_U.cs | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/MPItemTracker2/Forms/MainForm.Designer.cs b/MPItemTracker2/Forms/MainForm.Designer.cs index 1013f63..aa8c4a3 100644 --- a/MPItemTracker2/Forms/MainForm.Designer.cs +++ b/MPItemTracker2/Forms/MainForm.Designer.cs @@ -47,7 +47,7 @@ private void InitializeComponent() this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.Margin = new System.Windows.Forms.Padding(2); this.Name = "MainForm"; - this.Text = "Metroid Prime Item Tracker 2.3"; + this.Text = "Metroid Prime Item Tracker 2.4"; this.TransparencyKey = System.Drawing.Color.Pink; this.Load += new System.EventHandler(this.MainForm_Load); this.SizeChanged += new System.EventHandler(this.MainForm_SizeChanged); diff --git a/MPItemTracker2/MPItemTracker2.csproj b/MPItemTracker2/MPItemTracker2.csproj index b351f1f..fc194af 100644 --- a/MPItemTracker2/MPItemTracker2.csproj +++ b/MPItemTracker2/MPItemTracker2.csproj @@ -4,7 +4,7 @@ Exe net4.8 Debug_Windows;Release_Windows;Debug_Linux;Release_Linux - 2.3 + 2.4 MPItemTracker MPItemTracker MPItemTracker diff --git a/MPItemTracker2/Wrapper/Corruption/Corruption.cs b/MPItemTracker2/Wrapper/Corruption/Corruption.cs index fbd4b73..c4519eb 100644 --- a/MPItemTracker2/Wrapper/Corruption/Corruption.cs +++ b/MPItemTracker2/Wrapper/Corruption/Corruption.cs @@ -194,6 +194,7 @@ public override bool IsSwitchingState() public override bool HasPickup(string pickup) { + int i; switch (pickup) { case "Energy Tanks": @@ -250,9 +251,12 @@ public override bool HasPickup(string pickup) return HaveCommandVisor; case "XRay Visor": return HaveXRayVisor; + case "Energy Cells": + for (i = 1; i <= 9; i++) + if (EnergyCells(i - 1)) + return true; + return false; default: - if (pickup.StartsWith("Energy Cell ", StringComparison.InvariantCulture)) - return EnergyCells(Convert.ToInt32(pickup.Substring(12)) - 1); return false; } } diff --git a/MPItemTracker2/Wrapper/Prime/MPT_MP1_NTSC_J.cs b/MPItemTracker2/Wrapper/Prime/MPT_MP1_NTSC_J.cs index e1996cd..1680797 100644 --- a/MPItemTracker2/Wrapper/Prime/MPT_MP1_NTSC_J.cs +++ b/MPItemTracker2/Wrapper/Prime/MPT_MP1_NTSC_J.cs @@ -7,7 +7,7 @@ internal class MPT_MP1_NTSC_J : Prime protected const long OFF_CGAMEGLOBALOBJECTS = 0x804DEF10; protected const long OFF_CGAMESTATE = OFF_CGAMEGLOBALOBJECTS + 0x134; protected const long OFF_CSTATEMANAGER = 0x804BF69C; - protected const long OFF_MORPHBALLBOMBS_COUNT = 0x804C0F20; + protected const long OFF_MORPHBALLBOMBS_COUNT = 0x804C11A0; protected override long CPlayer { diff --git a/MPItemTracker2/Wrapper/Prime/MPT_MP1_NTSC_U.cs b/MPItemTracker2/Wrapper/Prime/MPT_MP1_NTSC_U.cs index f29cca7..2544365 100644 --- a/MPItemTracker2/Wrapper/Prime/MPT_MP1_NTSC_U.cs +++ b/MPItemTracker2/Wrapper/Prime/MPT_MP1_NTSC_U.cs @@ -7,7 +7,7 @@ internal class MPT_MP1_NTSC_U : Prime protected const long OFF_CGAMEGLOBALOBJECTS = 0x804DEC90; protected const long OFF_CGAMESTATE = OFF_CGAMEGLOBALOBJECTS + 0x134; protected const long OFF_CSTATEMANAGER = 0x804BF41C; - protected const long OFF_MORPHBALLBOMBS_COUNT = 0x804C11A0; + protected const long OFF_MORPHBALLBOMBS_COUNT = 0x804C0F20; protected override long CPlayer {