# Partial support for saved games with AI.

Support cancelling loads while inside a loader callback.
Fix use of ArchiveReader/Writer since their API changed.
Improve error-detection in deserializer to avoid crashes.
Report deserializer errors to users.
Expand load-error message box to fit message about invalid saved games.

This was SVN commit r10787.
This commit is contained in:
Ykkrosh
2011-12-22 14:04:32 +00:00
parent 5f0d5e4137
commit 6399ec0cd2
14 changed files with 202 additions and 117 deletions
+10 -3
View File
@@ -202,7 +202,7 @@ Status LDR_ProgressiveLoad(double time_budget, wchar_t* description, size_t max_
{
state = LOADING;
ret = ERR::TIMED_OUT; // make caller think we did something
ret = ERR::TIMED_OUT; // make caller think we did something
// progress already set to 0.0; that'll be passed back.
goto done;
}
@@ -219,7 +219,7 @@ Status LDR_ProgressiveLoad(double time_budget, wchar_t* description, size_t max_
const double estimated_duration = lr.estimated_duration_ms*1e-3;
if(!HaveTimeForNextTask(time_left, time_budget, lr.estimated_duration_ms))
{
ret = ERR::TIMED_OUT;
ret = ERR::TIMED_OUT;
goto done;
}
@@ -258,7 +258,7 @@ Status LDR_ProgressiveLoad(double time_budget, wchar_t* description, size_t max_
// .. function interrupted itself, i.e. timed out; abort.
if(timed_out)
{
ret = ERR::TIMED_OUT;
ret = ERR::TIMED_OUT;
goto done;
}
// .. failed; abort. loading will continue when we're called in
@@ -270,6 +270,13 @@ Status LDR_ProgressiveLoad(double time_budget, wchar_t* description, size_t max_
ret = (Status)status;
goto done;
}
// .. function called LDR_Cancel; abort. return OK since this is an
// intentional cancellation, not an error.
else if(state != LOADING)
{
ret = INFO::OK;
goto done;
}
// .. succeeded; continue and process next queued task.
}