Unit task no longer resets when a different task in a queue is cancelled, fixes bug #67.

This commit is contained in:
Jammyjamjamman
2018-02-21 02:17:48 +00:00
parent 66a1d6b255
commit dbe6697f16

View File

@@ -2744,10 +2744,7 @@ namespace Glest
{
changedActiveCommand = false;
retryCurrCommandCount = 0;
// Reset the progress if the command (possibly a task) is cancelled.
/// TODO: this is not an optimal solution because progress is reset even if the task does not track progression
/// e.g. production/ upgrades keep track of progression but walking/ attacking does not.
resetProgress2 ();
this->setCurrentUnitTitle ("");
//is empty?
@@ -2773,6 +2770,10 @@ namespace Glest
delete commands.back ();
commands.pop_back ();
// Reset the progress if the last task in the queue was cancelled.
/// TODO: extra if statement needed adding to fix this bug. Can this be avoided?
if (commands.empty()) resetProgress2();
safeMutex.ReleaseLock ();
//clear routes