Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/UnitAI.js
Show First 20 Lines • Show All 3,590 Lines • ▼ Show 20 Lines | |||||
UnitAI.prototype.AbleToMove = function(cmpUnitMotion) | UnitAI.prototype.AbleToMove = function(cmpUnitMotion) | ||||
{ | { | ||||
if (this.isImmobile || this.IsTurret()) | if (this.isImmobile || this.IsTurret()) | ||||
return false; | return false; | ||||
if (!cmpUnitMotion) | if (!cmpUnitMotion) | ||||
cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion); | cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion); | ||||
return !!cmpUnitMotion; | if (!cmpUnitMotion) | ||||
return false; | |||||
let cmpUpgrade = Engine.QueryInterface(this.entity, IID_Upgrade); | |||||
bb: function has super weird name and is used only once. inline | |||||
return !cmpUpgrade || !cmpUpgrade.IsUpgrading() || cmpUpgrade.IsUpgrading() && cmpUpgrade.CanMoveWhileUpgrading(); | |||||
}; | }; | ||||
UnitAI.prototype.IsFleeing = function() | UnitAI.prototype.IsFleeing = function() | ||||
{ | { | ||||
var state = this.GetCurrentState().split(".").pop(); | var state = this.GetCurrentState().split(".").pop(); | ||||
return (state == "FLEEING"); | return (state == "FLEEING"); | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 2,963 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
function has super weird name and is used only once. inline