Wall build orders shouldn't always be queued. Fixes #1673.

This was SVN commit r12676.
This commit is contained in:
Deiz 2012-09-15 05:45:49 +00:00
parent c4c65c02ac
commit bdde574ade
2 changed files with 22 additions and 17 deletions

View File

@ -540,7 +540,7 @@ function tryPlaceBuilding(queued)
return true;
}
function tryPlaceWall()
function tryPlaceWall(queued)
{
if (placementSupport.mode !== "wall")
{
@ -563,7 +563,7 @@ function tryPlaceWall()
"type": "construct-wall",
"autorepair": true,
"autocontinue": true,
"queued": true,
"queued": queued,
"entities": selection,
"wallSet": placementSupport.wallSet,
"pieces": wallPlacementInfo.pieces,
@ -864,21 +864,22 @@ function handleInputBeforeGui(ev, hoveredObject)
case "mousebuttondown":
if (ev.button == SDL_BUTTON_LEFT)
{
if (tryPlaceWall())
var queued = Engine.HotkeyIsPressed("session.queue");
if (tryPlaceWall(queued))
{
if (Engine.HotkeyIsPressed("session.queue"))
{
// continue building, just set a new starting position where we left off
placementSupport.position = placementSupport.wallEndPosition;
placementSupport.wallEndPosition = undefined;
inputState = INPUT_BUILDING_WALL_CLICK;
}
else
{
placementSupport.Reset();
inputState = INPUT_NORMAL;
}
if (queued)
{
// continue building, just set a new starting position where we left off
placementSupport.position = placementSupport.wallEndPosition;
placementSupport.wallEndPosition = undefined;
inputState = INPUT_BUILDING_WALL_CLICK;
}
else
{
placementSupport.Reset();
inputState = INPUT_NORMAL;
}
}
else
{

View File

@ -743,7 +743,11 @@ function TryConstructWall(player, cmpPlayer, controlAllUnits, cmd)
for (; i < cmd.pieces.length; ++i)
{
var piece = cmd.pieces[i];
// All wall pieces after the first must be queued.
if (i > 0 && !cmd.queued)
cmd.queued = true;
// 'lastTowerControlGroup' must always be defined and valid here, except if we're at the first piece and we didn't do
// start position snapping (implying that the first entity we build must be a tower)
if (lastTowerControlGroup === null || lastTowerControlGroup == INVALID_ENTITY)