mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-07-04 05:55:47 -07:00
fix lag when a garrisoned ship is destroyed in the middle of water
This was SVN commit r16636.
This commit is contained in:
parent
d664fadc38
commit
b30e7ca26b
1 changed files with 8 additions and 0 deletions
|
|
@ -414,7 +414,15 @@ GarrisonHolder.prototype.PerformEject = function(entities, forced)
|
||||||
ejectedEntities.push(entity);
|
ejectedEntities.push(entity);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
success = false;
|
success = false;
|
||||||
|
// If the garrisonHolder is a sinking ship, stop trying to eject entities when one fail
|
||||||
|
// to avoid using time when no shoreline around
|
||||||
|
var cmpHealth = Engine.QueryInterface(this.entity, IID_Health);
|
||||||
|
var cmpIdentity = Engine.QueryInterface(this.entity, IID_Identity);
|
||||||
|
if ((!cmpHealth || cmpHealth.GetHitpoints() == 0) && cmpIdentity && cmpIdentity.HasClass("Ship"))
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.OrderWalkToRallyPoint(ejectedEntities);
|
this.OrderWalkToRallyPoint(ejectedEntities);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue