Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/helpers/Commands.js
Show First 20 Lines • Show All 1,130 Lines • ▼ Show 20 Lines | if (!cmpPlayer.TrySubtractResources(costs)) | ||||
cmpPosition.MoveOutOfWorld(); | cmpPosition.MoveOutOfWorld(); | ||||
return false; | return false; | ||||
} | } | ||||
var cmpVisual = Engine.QueryInterface(ent, IID_Visual); | var cmpVisual = Engine.QueryInterface(ent, IID_Visual); | ||||
if (cmpVisual && cmd.actorSeed !== undefined) | if (cmpVisual && cmd.actorSeed !== undefined) | ||||
cmpVisual.SetActorSeed(cmd.actorSeed); | cmpVisual.SetActorSeed(cmd.actorSeed); | ||||
if (cmd.snapEntity) | |||||
{ | |||||
let cmpBuildSlot = Engine.QueryInterface(cmd.snapEntity, IID_BuildSlot); | |||||
if (cmpBuildSlot) | |||||
cmpBuildSlot.InitConstruction(ent); | |||||
} | |||||
// Initialise the foundation | // Initialise the foundation | ||||
var cmpFoundation = Engine.QueryInterface(ent, IID_Foundation); | var cmpFoundation = Engine.QueryInterface(ent, IID_Foundation); | ||||
cmpFoundation.InitialiseConstruction(player, cmd.template); | cmpFoundation.InitialiseConstruction(player, cmd.template); | ||||
// send Metadata info if any | // send Metadata info if any | ||||
if (cmd.metadata) | if (cmd.metadata) | ||||
Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } ); | Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } ); | ||||
▲ Show 20 Lines • Show All 579 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator