mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-07-04 05:55:47 -07:00
Take unit obstruction size into account when checking if in range for garrisoning. Reduce CC loading range in consequence. Fixes #2190 .
This was SVN commit r14428.
This commit is contained in:
parent
10e8fb9105
commit
4158283fd4
2 changed files with 5 additions and 1 deletions
|
|
@ -4131,6 +4131,10 @@ UnitAI.prototype.CheckGarrisonRange = function(target)
|
|||
if (!cmpGarrisonHolder)
|
||||
return false;
|
||||
var range = cmpGarrisonHolder.GetLoadingRange();
|
||||
|
||||
var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|
||||
if (cmpObstruction)
|
||||
range.max += cmpObstruction.GetUnitRadius()*1.5; // multiply by something larger than sqrt(2)
|
||||
|
||||
var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion);
|
||||
return cmpUnitMotion.IsInTargetRange(target, range.min, range.max);
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
<EjectEntitiesOnDestroy>true</EjectEntitiesOnDestroy>
|
||||
<List datatype="tokens">Support Infantry Cavalry</List>
|
||||
<BuffHeal>1</BuffHeal>
|
||||
<LoadingRange>2</LoadingRange>
|
||||
<LoadingRange>1</LoadingRange>
|
||||
</GarrisonHolder>
|
||||
<Health>
|
||||
<Max>3000</Max>
|
||||
|
|
|
|||
Loading…
Reference in a new issue