1
0
forked from mirrors/0ad

Fix missing observermode for players who won (and that's why a ternary was used there before 9f796068f8).

Don't start the defeat music when clicking on resign and then restarting
it right on the next turn.

This was SVN commit r18539.
This commit is contained in:
elexis
2016-07-21 01:06:35 +00:00
parent c84d41dc41
commit fb8f360ef0
@@ -446,9 +446,8 @@ function playerFinished(player, won)
global.music.states.DEFEAT
);
// Select "observer" item
if (!won)
Engine.GetGUIObjectByName("viewPlayer").selected = 0;
// Select "observer" item on loss. On win enable observermode without changing perspective
Engine.GetGUIObjectByName("viewPlayer").selected = won ? g_ViewedPlayer : 0;
g_ConfirmExit = won ? "won" : "defeated";
}
@@ -510,8 +509,6 @@ function resignGame(leaveGameAfterResign)
"resign": true
});
global.music.setState(global.music.states.DEFEAT);
if (!leaveGameAfterResign)
resumeGame(true);
}