Skip to content

Commit 3ac6522

Browse files
committed
better fix for progress issue
1 parent df1ac0d commit 3ac6522

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

FlashpointSecurePlayer/ProgressManager.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -290,20 +290,23 @@ public static int Steps {
290290
}
291291

292292
private static void Show() {
293-
Goal[] goalsArray = Goals.ToArray();
293+
// when the stack is converted to an array
294+
// it is done in reverse!!
295+
// this caused bugs when
296+
// adapting this from the JavaScript version
297+
// (which just uses array push/pop)
298+
Goal[] goalsArray = Goals.Reverse().ToArray();
294299

295300
if (goalsArray.ElementAtOrDefault(0) == null) {
296301
return;
297302
}
298-
299-
int len = goalsArray.Length - 1;
303+
300304
int size = 0;
301305
double reciprocal = 1;
302306
double multiplier = 0;
303-
304-
// this MUST loop backwards
305-
for (int i = len; i >= 0; i--) {
306-
for (int j = len; j > i; j--) {
307+
308+
for (int i = 0; i < goalsArray.Length; i++) {
309+
for (int j = 0; j < i; j++) {
307310
size = goalsArray[j].Size;
308311

309312
if (size == 0) {

0 commit comments

Comments
 (0)