1 (edited by MrPonton 2017-07-31 18:01:19)

Topic: *FIXED* Bug: Infinite Loop in MoveEditorWindow.cs

There is a bug that will cause an infinite loop or crash to occur when adding Speed Key Frames' New Speed value.

Two things would happen if you typed 0 as the value.

(Note: since the editor updates every fraction of a second, trying to type 0.1 will have it hit this before you even type the decimal):

======================================

1) You would hit a function that would divide by 0.

2) When you fix that, you would get stuck in an infinite do-while loop because a value was adding 0 to itself and expecting to be incremented on each pass.

Here's the fix for this issue:

MoveEditorWindow.cs
1) Look for the following line of code:

displacement /= moveInfo.animSpeedKeyFrame[i].speed;

Replace with the following:

if (moveInfo.animSpeedKeyFrame[i].speed != 0)
    displacement /= moveInfo.animSpeedKeyFrame[i].speed;
else
    displacement = 0;

2) Look for the following line of code:

} while (animTime < moveInfo.animationClip.length);

Replace with the following:

} while (animTime < moveInfo.animationClip.length || animTime == 0);

Share

Thumbs up +1 Thumbs down

Re: *FIXED* Bug: Infinite Loop in MoveEditorWindow.cs

Awesome man been wondering what caused that I had a work around I was using by just pasting my values in.

My editor doesn't crash anymore when inputting values great job!!

Terrordrome Reign of the Legends Out now on Steam!!
https://store.steampowered.com/app/1291 … e_Legends/
Terrordrome Project Manager

Re: *FIXED* Bug: Infinite Loop in MoveEditorWindow.cs

Ha, I never thought to paste my fractional values in. If I knew that I may not have attempted to fix this loop crash lol.

Share

Thumbs up Thumbs down