Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Turretable.js
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | if (cmpUnitMotion) | ||||
cmpUnitMotion.SetFacePointAfterMove(false); | cmpUnitMotion.SetFacePointAfterMove(false); | ||||
// Remove the unit's obstruction to avoid interfering with pathing. | // Remove the unit's obstruction to avoid interfering with pathing. | ||||
let cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction); | let cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction); | ||||
if (cmpObstruction) | if (cmpObstruction) | ||||
cmpObstruction.SetActive(false); | cmpObstruction.SetActive(false); | ||||
Engine.PostMessage(this.entity, MT_TurretedStateChanged, { | Engine.PostMessage(this.entity, MT_TurretedStateChanged, { | ||||
"entity": this.entity, | |||||
"oldHolder": INVALID_ENTITY, | "oldHolder": INVALID_ENTITY, | ||||
"holderID": target | "holderID": target | ||||
}); | }); | ||||
return true; | return true; | ||||
}; | }; | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | Turretable.prototype.LeaveTurret = function(forced = false) | ||||
} | } | ||||
// Reset the obstruction flags to template defaults. | // Reset the obstruction flags to template defaults. | ||||
let cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction); | let cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction); | ||||
if (cmpObstruction) | if (cmpObstruction) | ||||
cmpObstruction.SetActive(true); | cmpObstruction.SetActive(true); | ||||
Engine.PostMessage(this.entity, MT_TurretedStateChanged, { | Engine.PostMessage(this.entity, MT_TurretedStateChanged, { | ||||
"entity": this.entity, | |||||
"oldHolder": this.holder, | "oldHolder": this.holder, | ||||
"holderID": INVALID_ENTITY | "holderID": INVALID_ENTITY | ||||
}); | }); | ||||
let cmpRallyPoint = Engine.QueryInterface(this.holder, IID_RallyPoint); | let cmpRallyPoint = Engine.QueryInterface(this.holder, IID_RallyPoint); | ||||
// Need to delete this before ordering to a rally | // Need to delete this before ordering to a rally | ||||
// point else we may not occupy another turret point. | // point else we may not occupy another turret point. | ||||
Show All 38 Lines |
Wildfire Games · Phabricator