Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/helpers/Commands.js
Show First 20 Lines • Show All 1,285 Lines • ▼ Show 20 Lines | for (; i < pieces.length; ++i) | ||||
// while overlapping the snapped entity. | // while overlapping the snapped entity. | ||||
if (i == pieces.length - 1 && cmd.endSnappedEntity) | if (i == pieces.length - 1 && cmd.endSnappedEntity) | ||||
{ | { | ||||
var cmpEndSnappedObstruction = Engine.QueryInterface(cmd.endSnappedEntity, IID_Obstruction); | var cmpEndSnappedObstruction = Engine.QueryInterface(cmd.endSnappedEntity, IID_Obstruction); | ||||
if (cmpEndSnappedObstruction) | if (cmpEndSnappedObstruction) | ||||
constructPieceCmd.obstructionControlGroup2 = cmpEndSnappedObstruction.GetControlGroup(); | constructPieceCmd.obstructionControlGroup2 = cmpEndSnappedObstruction.GetControlGroup(); | ||||
} | } | ||||
// Waypoints | |||||
let cmpGuiInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); | |||||
if (cmpGuiInterface) | |||||
cmpGuiInterface.DisplayWayPoint(player, constructPieceCmd); | |||||
var pieceEntityId = TryConstructBuilding(player, cmpPlayer, controlAllUnits, constructPieceCmd); | var pieceEntityId = TryConstructBuilding(player, cmpPlayer, controlAllUnits, constructPieceCmd); | ||||
if (pieceEntityId) | if (pieceEntityId) | ||||
{ | { | ||||
// wall piece foundation successfully built, save the entity ID in the piece info object so we can reference it later | // wall piece foundation successfully built, save the entity ID in the piece info object so we can reference it later | ||||
piece.ent = pieceEntityId; | piece.ent = pieceEntityId; | ||||
// if we built a tower, do the control group dance (see outline above) and update lastTowerControlGroup and lastTowerIndex | // if we built a tower, do the control group dance (see outline above) and update lastTowerControlGroup and lastTowerIndex | ||||
if (piece.template == cmd.wallSet.templates.tower) | if (piece.template == cmd.wallSet.templates.tower) | ||||
▲ Show 20 Lines • Show All 391 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator