Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/helpers/Commands.js
Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | "reveal-map": function(player, cmd, data) | ||||
// Reveal the map for all players, not just the current player, | // Reveal the map for all players, not just the current player, | ||||
// primarily to make it obvious to everyone that the player is cheating | // primarily to make it obvious to everyone that the player is cheating | ||||
var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); | var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); | ||||
cmpRangeManager.SetLosRevealAll(-1, cmd.enable); | cmpRangeManager.SetLosRevealAll(-1, cmd.enable); | ||||
}, | }, | ||||
"walk": function(player, cmd, data) | "walk": function(player, cmd, data) | ||||
{ | { | ||||
if (cmd.target) | |||||
{ | |||||
GetFormationUnitAIs(data.entities, player).forEach(cmpUnitAI => { | |||||
cmpUnitAI.WalkToTarget(cmd.target, cmd.queued); | |||||
}); | |||||
return; | |||||
} | |||||
Freagarach: You can do an `else` and ditch the return and braces. | |||||
GetFormationUnitAIs(data.entities, player).forEach(cmpUnitAI => { | GetFormationUnitAIs(data.entities, player).forEach(cmpUnitAI => { | ||||
cmpUnitAI.Walk(cmd.x, cmd.z, cmd.queued); | cmpUnitAI.Walk(cmd.x, cmd.z, cmd.queued); | ||||
}); | }); | ||||
}, | }, | ||||
"walk-custom": function(player, cmd, data) | "walk-custom": function(player, cmd, data) | ||||
{ | { | ||||
for (let ent in data.entities) | for (let ent in data.entities) | ||||
▲ Show 20 Lines • Show All 1,570 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
You can do an else and ditch the return and braces.