Skip to content
Snippets Groups Projects
Commit 517ce6cd authored by Knuiman, Bart's avatar Knuiman, Bart
Browse files

Bugfix.

parent 55672d13
No related branches found
No related tags found
No related merge requests found
......@@ -60,14 +60,15 @@ namespace Wander
internal bool valid;
internal int numRings;
internal bool filter;
internal bool finished;
internal float invalidSample;
internal UnityWebRequest www;
internal bool started;
internal bool retried;
internal Task<HeightData> decodeTiffBytesTask;
public HeightData HeightData => heightData;
public bool Valid => valid;
public bool Retried => retried;
public bool Started => started;
......@@ -81,14 +82,28 @@ namespace Wander
}
}
public void Retry()
{
Debug.Assert( started );
Debug.Assert( !retried, "Already retried" );
www = UnityWebRequest.Get( www.uri );
www.SendWebRequest();
retried = true;
}
public bool IsFinished()
{
if (finished || www == null)
if (www == null)
return true;
// Still in progress
if (!www.isDone)
return false;
if (www.result == UnityWebRequest.Result.InProgress) // If there is an error, then Done is not set true..
{
if (!www.isDone)
return false;
}
// Either isDone is true, or result is error but not InProgress.
// Request is done, but not valid.
if (www.result != UnityWebRequest.Result.Success)
......@@ -140,10 +155,10 @@ namespace Wander
}
decodeTiffBytesTask = null;
www = null;
finished = true;
return true;
}
return finished;
return false;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment