1
1
forked from 0ad/0ad

fix lag when a garrisoned ship is destroyed in the middle of water

This was SVN commit r16636.
This commit is contained in:
mimo 2015-05-08 15:11:32 +00:00
parent d664fadc38
commit b30e7ca26b

View File

@ -414,7 +414,15 @@ GarrisonHolder.prototype.PerformEject = function(entities, forced)
ejectedEntities.push(entity);
}
else
{
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);