Differential D3804 Diff 16937 ps/trunk/binaries/data/mods/public/simulation/components/RallyPoint.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/RallyPoint.js
Show First 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | if (!commands.length || | ||||
return; | return; | ||||
for (let command of commands) | for (let command of commands) | ||||
ProcessCommand(owner, command); | ProcessCommand(owner, command); | ||||
}; | }; | ||||
RallyPoint.prototype.OnGlobalEntityRenamed = function(msg) | RallyPoint.prototype.OnGlobalEntityRenamed = function(msg) | ||||
{ | { | ||||
for (var data of this.data) | for (let data of this.data) | ||||
{ | { | ||||
if (!data) | if (!data) | ||||
continue; | continue; | ||||
if (data.target && data.target == msg.entity) | if (data.target && data.target == msg.entity) | ||||
data.target = msg.newentity; | data.target = msg.newentity; | ||||
if (data.source && data.source == msg.entity) | if (data.source && data.source == msg.entity) | ||||
data.source = msg.newentity; | data.source = msg.newentity; | ||||
} | } | ||||
if (msg.entity != this.entity) | |||||
return; | |||||
let cmpRallyPointNew = Engine.QueryInterface(msg.newentity, IID_RallyPoint); | |||||
if (cmpRallyPointNew) | |||||
{ | |||||
let rallyCoords = this.GetPositions(); | |||||
let rallyData = this.GetData(); | |||||
for (let i = 0; i < rallyCoords.length; ++i) | |||||
{ | |||||
cmpRallyPointNew.AddPosition(rallyCoords[i].x, rallyCoords[i].z); | |||||
cmpRallyPointNew.AddData(rallyData[i]); | |||||
} | |||||
} | |||||
}; | }; | ||||
RallyPoint.prototype.OnOwnershipChanged = function(msg) | RallyPoint.prototype.OnOwnershipChanged = function(msg) | ||||
{ | { | ||||
// No need to reset when constructing or destructing the entity | // No need to reset when constructing or destructing the entity | ||||
if (msg.from == INVALID_PLAYER || msg.to == INVALID_PLAYER) | if (msg.from == INVALID_PLAYER || msg.to == INVALID_PLAYER) | ||||
return; | return; | ||||
Show All 17 Lines |
Wildfire Games · Phabricator