1 | Index: 0ad/binaries/data/mods/public/simulation/components/Foundation.js
|
---|
2 | ===================================================================
|
---|
3 | --- 0ad/binaries/data/mods/public/simulation/components/Foundation.js (revision 13389)
|
---|
4 | +++ 0ad/binaries/data/mods/public/simulation/components/Foundation.js (working copy)
|
---|
5 | @@ -277,6 +277,30 @@
|
---|
6 | var rot = cmpPosition.GetRotation();
|
---|
7 | cmpBuildingPosition.SetYRotation(rot.y);
|
---|
8 | cmpBuildingPosition.SetXZRotation(rot.x, rot.z);
|
---|
9 | + var cmpRallyPoint = Engine.QueryInterface(this.entity, IID_RallyPoint);
|
---|
10 | + var cmpBuildingRallyPoint = Engine.QueryInterface(building, IID_RallyPoint);
|
---|
11 | + if(cmpRallyPoint)
|
---|
12 | + {
|
---|
13 | + var rallyCoords = cmpRallyPoint.GetPositions();
|
---|
14 | + if (rallyCoords[0])
|
---|
15 | + {
|
---|
16 | + var l=rallyCoords.length;
|
---|
17 | + var cmpBuildingRallyPointRenderer = Engine.QueryInterface(building, IID_RallyPointRenderer);
|
---|
18 | + if(l>1)
|
---|
19 | + for each (var rallyCoord in rallyCoords)
|
---|
20 | + {
|
---|
21 | + cmpBuildingRallyPoint.AddPosition(rallyCoord["x"], rallyCoord["z"]);
|
---|
22 | + cmpBuildingRallyPointRenderer.AddPosition({'x': rallyCoord["x"], 'y': rallyCoord["z"]})
|
---|
23 | + }
|
---|
24 | + else if(l>0)
|
---|
25 | + {
|
---|
26 | + cmpBuildingRallyPoint.AddPosition(rallyCoords[0]["x"], rallyCoords[0]["z"]);
|
---|
27 | + cmpBuildingRallyPointRenderer.SetPosition({'x': rallyCoords[0]["x"], 'y': rallyCoords[0]["z"]});
|
---|
28 | + }
|
---|
29 | + cmpBuildingRallyPoint.AddData(cmpRallyPoint.GetData());
|
---|
30 | + }
|
---|
31 | + }
|
---|
32 | // TODO: should add a ICmpPosition::CopyFrom() instead of all this
|
---|
33 |
|
---|
34 | // ----------------------------------------------------------------------
|
---|
35 | Index: 0ad/source/simulation2/components/CCmpTemplateManager.cpp
|
---|
36 | ===================================================================
|
---|
37 | --- 0ad/source/simulation2/components/CCmpTemplateManager.cpp (revision 13389)
|
---|
38 | +++ 0ad/source/simulation2/components/CCmpTemplateManager.cpp (working copy)
|
---|
39 | @@ -566,6 +566,8 @@
|
---|
40 | permittedComponentTypes.insert("Sound");
|
---|
41 | permittedComponentTypes.insert("Vision");
|
---|
42 | permittedComponentTypes.insert("AIProxy");
|
---|
43 | + permittedComponentTypes.insert("RallyPoint");
|
---|
44 | + permittedComponentTypes.insert("RallyPointRenderer");
|
---|
45 |
|
---|
46 | CParamNode::LoadXMLString(out, "<Entity/>");
|
---|
47 | out.CopyFilteredChildrenOfChild(in, "Entity", permittedComponentTypes);
|
---|