mirror of
https://github.com/glest/glest-source.git
synced 2025-08-30 19:29:47 +02:00
Unit task no longer resets when a different task in a queue is cancelled, fixes bug #67.
This commit is contained in:
@@ -2744,10 +2744,7 @@ namespace Glest
|
|||||||
{
|
{
|
||||||
changedActiveCommand = false;
|
changedActiveCommand = false;
|
||||||
retryCurrCommandCount = 0;
|
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 ("");
|
this->setCurrentUnitTitle ("");
|
||||||
|
|
||||||
//is empty?
|
//is empty?
|
||||||
@@ -2773,6 +2770,10 @@ namespace Glest
|
|||||||
delete commands.back ();
|
delete commands.back ();
|
||||||
commands.pop_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 ();
|
safeMutex.ReleaseLock ();
|
||||||
|
|
||||||
//clear routes
|
//clear routes
|
||||||
|
Reference in New Issue
Block a user