Skip to content

Commit 04644cd

Browse files
authored
Merge pull request #67 from ingwarsw/patch-2
Fix IOPOD climbing
2 parents b05af7c + 6edcdda commit 04644cd

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

NGUInjector/Managers/ZoneHelpers.cs

+6-10
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,14 @@ internal static void OptimizeITOPOD()
9696
if (Main.Character.adventure.zone < 1000) return;
9797
var controller = Main.Character.adventureController;
9898
var level = controller.itopodLevel;
99+
var highestOpen = Main.Character.adventure.highestItopodLevel;
99100
var optimal = CalculateBestItopodLevel();
100-
if (level == optimal) return;
101101
controller.itopodStartInput.text = optimal.ToString();
102-
if (optimal == Main.Character.adventure.highestItopodLevel - 1)
103-
{
104-
optimal = Main.Character.adventureController.maxItopodLevel();
105-
Main.Log("Highest ITOPOD floor is hit so setting climb mode");
106-
}
107-
108102
controller.itopodEndInput.text = optimal.ToString();
109103
controller.verifyItopodInputs();
104+
if (level == optimal) return; // we are on optimal floor
105+
if (level < optimal && level >= highestOpen - 1) return; // we are climbing
110106
controller.zoneSelector.changeZone(1000);
111-
//controller.log.AddEvent($"The CHEATER Floor Shifter changed your current floor from {level} to {optimal}");
112107
}
113108

114109
internal static int CalculateBestItopodLevel()
@@ -120,8 +115,9 @@ internal static int CalculateBestItopodLevel()
120115
var num2 = Convert.ToInt32(Math.Floor(Math.Log(num1, 1.05)));
121116
if (num2 < 1)
122117
return 1;
123-
if (num2 >= c.adventure.highestItopodLevel)
124-
num2 = c.adventure.highestItopodLevel - 1;
118+
var maxLevel = c.adventureController.maxItopodLevel();
119+
if (num2 > maxLevel)
120+
num2 = maxLevel;
125121
return num2;
126122
}
127123
}

0 commit comments

Comments
 (0)