Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/ai/common-api/shared.js
Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | else if (name.indexOf("resource|") !== -1) | ||||
let resource = {}; | let resource = {}; | ||||
for (let key in base) | for (let key in base) | ||||
if (!m.g_ResourceForbiddenComponents[key]) | if (!m.g_ResourceForbiddenComponents[key]) | ||||
resource[key] = base[key]; | resource[key] = base[key]; | ||||
this._derivedTemplates[name] = resource; | this._derivedTemplates[name] = resource; | ||||
return resource; | return resource; | ||||
} | } | ||||
else if (name.indexOf("ungarrisonable|") !== -1) | |||||
{ | |||||
let base = this.GetTemplate(name.substr(15)); | |||||
let ent = {}; | |||||
for (let key in base) | |||||
if (key !== "Garrisonable") | |||||
ent[key] = base[key]; | |||||
else | |||||
ent[key] = "false"; | |||||
this._derivedTemplates[name] = ent; | |||||
return ent; | |||||
} | |||||
error("Tried to retrieve invalid template '"+name+"'"); | error("Tried to retrieve invalid template '"+name+"'"); | ||||
return null; | return null; | ||||
}; | }; | ||||
/** | /** | ||||
* Initialize the shared component. | * Initialize the shared component. | ||||
* We need to know the initial state of the game for this, as we will use it. | * We need to know the initial state of the game for this, as we will use it. | ||||
▲ Show 20 Lines • Show All 346 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator