forked from mirrors/0ad
Fix cheering issue entering from idle state
Introduced in e543b01077.
Units entering cheering from idle state, may not check their surrounding
for pottential targets yet, so they will react incorrectly when
attacked.
Pointed out by @Freagarach in
https://code.wildfiregames.com/D1977?id=10404#inline-52415 and turned
out to be issue.
Differential revision: D3455
Fixes: #5966
Reviewed by: @wraitii
This was SVN commit r24774.
This commit is contained in:
@@ -1523,8 +1523,8 @@ UnitAI.prototype.UnitFsmSpec = {
|
||||
|
||||
"IDLE": {
|
||||
"Order.Cheer": function() {
|
||||
// Do not cheer if there is no cheering time.
|
||||
if (!this.cheeringTime)
|
||||
// Do not cheer if there is no cheering time and we are not idle yet.
|
||||
if (!this.cheeringTime || !this.isIdle)
|
||||
return { "discardOrder": true };
|
||||
|
||||
this.SetNextState("CHEERING");
|
||||
|
||||
Reference in New Issue
Block a user