Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/maps/scenarios/units_demo.js
Show All 27 Lines | |||||
/** | /** | ||||
* Space between entities. | * Space between entities. | ||||
*/ | */ | ||||
let gap = 14; | let gap = 14; | ||||
let cmpTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager); | let cmpTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager); | ||||
for (let template of cmpTemplateManager.FindAllTemplates(actors)) | for (let template of cmpTemplateManager.FindAllTemplates(actors)) | ||||
{ | { | ||||
print(template + "...\n"); | print(template + "…\n"); | ||||
let ent = Engine.AddEntity(template); | let ent = Engine.AddEntity(template); | ||||
if (!ent) | if (!ent) | ||||
{ | { | ||||
error("Failed to load " + template + "\n"); | error("Failed to load " + template + "\n"); | ||||
continue; | continue; | ||||
} | } | ||||
let cmpFootprint = Engine.QueryInterface(ent, IID_Footprint); | let cmpFootprint = Engine.QueryInterface(ent, IID_Footprint); | ||||
if (!cmpFootprint) | if (!cmpFootprint) | ||||
{ | { | ||||
print(template + " has no footprint\n"); | print(template + " has no footprint\n"); | ||||
continue; | continue; | ||||
} | } | ||||
let shape = cmpFootprint.GetShape(); | let shape = cmpFootprint.GetShape(); | ||||
let w = shape.width; | let w = shape.width; | ||||
let h = shape.depth; | let h = shape.depth; | ||||
if (shape.type == 'circle') | if (shape.type == 'circle') | ||||
w = h = shape.radius * 2; | w = h = shape.radius * 2; | ||||
Lint: ESLintBear (no-multi-assign): `Unexpected chained assignment.` | |||||
if (x + w >= stopX) | if (x + w >= stopX) | ||||
{ | { | ||||
// Start a new row | // Start a new row | ||||
x = startX; | x = startX; | ||||
z += maxh + gap; | z += maxh + gap; | ||||
maxh = 0; | maxh = 0; | ||||
} | } | ||||
Show All 19 Lines |
Wildfire Games · Phabricator
Unexpected chained assignment.