Prevent healers from healing themselves.
This was SVN commit r12398.
This commit is contained in:
parent
61cf6a6040
commit
8c97458de7
@ -347,6 +347,10 @@ function getActionInfo(action, target)
|
|||||||
// The check if the target is unhealable is done by targetState.needsHeal
|
// The check if the target is unhealable is done by targetState.needsHeal
|
||||||
if (entState.Healer && hasClass(targetState, "Unit") && targetState.needsHeal && (playerOwned || allyOwned))
|
if (entState.Healer && hasClass(targetState, "Unit") && targetState.needsHeal && (playerOwned || allyOwned))
|
||||||
{
|
{
|
||||||
|
// Healers can't heal themselves.
|
||||||
|
if (entState.id == targetState.id)
|
||||||
|
return {"possible": false};
|
||||||
|
|
||||||
var unhealableClasses = entState.Healer.unhealableClasses;
|
var unhealableClasses = entState.Healer.unhealableClasses;
|
||||||
for each (var unitClass in targetState.identity.classes)
|
for each (var unitClass in targetState.identity.classes)
|
||||||
{
|
{
|
||||||
|
@ -333,6 +333,13 @@ var UnitFsmSpec = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Healers can't heal themselves.
|
||||||
|
if (this.order.data.target == this.entity)
|
||||||
|
{
|
||||||
|
this.FinishOrder();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if the target is in range
|
// Check if the target is in range
|
||||||
if (this.CheckTargetRange(this.order.data.target, IID_Heal))
|
if (this.CheckTargetRange(this.order.data.target, IID_Heal))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user