Don't exceed vision range in hold ground and stand ground query ranges
Differential Revision: https://code.wildfiregames.com/D1394 Reviewed by: bb Comments by: elexis Refs: #4725 This was SVN commit r21584.
This commit is contained in:
parent
182103c143
commit
b36363a53e
@ -5570,8 +5570,11 @@ UnitAI.prototype.GetQueryRange = function(iid)
|
|||||||
if (!cmpRanged)
|
if (!cmpRanged)
|
||||||
return ret;
|
return ret;
|
||||||
var range = iid !== IID_Attack ? cmpRanged.GetRange() : cmpRanged.GetFullAttackRange();
|
var range = iid !== IID_Attack ? cmpRanged.GetRange() : cmpRanged.GetFullAttackRange();
|
||||||
|
var cmpVision = Engine.QueryInterface(this.entity, IID_Vision);
|
||||||
|
if (!cmpVision)
|
||||||
|
return ret;
|
||||||
ret.min = range.min;
|
ret.min = range.min;
|
||||||
ret.max = range.max;
|
ret.max = Math.min(range.max, cmpVision.GetRange());
|
||||||
}
|
}
|
||||||
else if (this.GetStance().respondChase)
|
else if (this.GetStance().respondChase)
|
||||||
{
|
{
|
||||||
@ -5590,8 +5593,8 @@ UnitAI.prototype.GetQueryRange = function(iid)
|
|||||||
var cmpVision = Engine.QueryInterface(this.entity, IID_Vision);
|
var cmpVision = Engine.QueryInterface(this.entity, IID_Vision);
|
||||||
if (!cmpVision)
|
if (!cmpVision)
|
||||||
return ret;
|
return ret;
|
||||||
var halfvision = cmpVision.GetRange() / 2;
|
var vision = cmpVision.GetRange();
|
||||||
ret.max = range.max + halfvision;
|
ret.max = Math.min(range.max + vision / 2, vision);
|
||||||
}
|
}
|
||||||
// We probably have stance 'passive' and we wouldn't have a range,
|
// We probably have stance 'passive' and we wouldn't have a range,
|
||||||
// but as it is the default for healers we need to set it to something sane.
|
// but as it is the default for healers we need to set it to something sane.
|
||||||
|
Loading…
Reference in New Issue
Block a user