mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 04:26:27 +00:00
protect possible infinite loop when an order is issued on the same turn as garrisoning is effectively processed
Reviewed By: O2 JS Simulation, elexis, s0600204, bb Differential Revision: https://code.wildfiregames.com/D686 This was SVN commit r19900.
This commit is contained in:
@@ -4975,7 +4975,13 @@ UnitAI.prototype.AddOrder = function(type, data, queued)
|
||||
if (queued)
|
||||
this.PushOrder(type, data);
|
||||
else
|
||||
{
|
||||
// May happen only if an order arrives on the same turn the unit is garrisoned
|
||||
// in that case, just forget the order as this will lead to a weird state
|
||||
if (this.IsGarrisoned() && !this.IsTurret() && type != "Ungarrison")
|
||||
return;
|
||||
this.ReplaceOrder(type, data);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user