Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Gate.js
Show All 14 Lines | |||||
Gate.prototype.Init = function() | Gate.prototype.Init = function() | ||||
{ | { | ||||
this.allies = []; | this.allies = []; | ||||
this.ignoreList = []; | this.ignoreList = []; | ||||
this.opened = false; | this.opened = false; | ||||
this.locked = false; | this.locked = false; | ||||
}; | }; | ||||
Gate.prototype.Update = function(newTemplate) | |||||
{ | |||||
this.template = newTemplate; | |||||
// We should have an owner, as we had one before the template change. | |||||
this.SetupRangeQuery(Engine.QueryInterface(this.entity, IID_Ownership).GetOwner()); | |||||
if (!this.locked) { | |||||
// TODO: ordering dependency on cmpObstruction here... | |||||
let cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction); | |||||
cmpObstruction.SetDisableBlockMovementPathfinding(this.opened, true, 0); | |||||
} | |||||
}; | |||||
Gate.prototype.OnOwnershipChanged = function(msg) | Gate.prototype.OnOwnershipChanged = function(msg) | ||||
{ | { | ||||
if (msg.to != INVALID_PLAYER) | if (msg.to != INVALID_PLAYER) | ||||
{ | { | ||||
this.SetupRangeQuery(msg.to); | this.SetupRangeQuery(msg.to); | ||||
// Set the initial state, but don't play unlocking sound | // Set the initial state, but don't play unlocking sound | ||||
if (!this.locked) | if (!this.locked) | ||||
this.UnlockGate(true); | this.UnlockGate(true); | ||||
▲ Show 20 Lines • Show All 255 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator