From 47b9d2a02eefcbd5ef1957e90a87269a3ddac63e Mon Sep 17 00:00:00 2001 From: Freagarach Date: Sat, 26 Dec 2020 05:46:13 +0000 Subject: [PATCH] Play sound of entity that is able to perform a command. In unit_actions.js sounds of the first entity that is able are now played, instead of trying to play a sound of the first entity of the selection, which may or may not be able to perform the command. Differential revision: D3099 Reviewed by: @bb This was SVN commit r24449. --- .../mods/public/gui/session/unit_actions.js | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/binaries/data/mods/public/gui/session/unit_actions.js b/binaries/data/mods/public/gui/session/unit_actions.js index 15f49b711b..92183e52a3 100644 --- a/binaries/data/mods/public/gui/session/unit_actions.js +++ b/binaries/data/mods/public/gui/session/unit_actions.js @@ -59,7 +59,7 @@ var g_UnitActions = Engine.GuiInterfaceCall("PlaySound", { "name": "order_walk", - "entity": selection[0] + "entity": action.firstAbleEntity }); return true; @@ -109,7 +109,7 @@ var g_UnitActions = Engine.GuiInterfaceCall("PlaySound", { "name": "order_walk", - "entity": selection[0] + "entity": action.firstAbleEntity }); return true; @@ -151,7 +151,7 @@ var g_UnitActions = Engine.GuiInterfaceCall("PlaySound", { "name": "order_attack", - "entity": selection[0] + "entity": action.firstAbleEntity }); return true; @@ -196,7 +196,7 @@ var g_UnitActions = Engine.GuiInterfaceCall("PlaySound", { "name": "order_attack", - "entity": selection[0] + "entity": action.firstAbleEntity }); return true; @@ -251,7 +251,7 @@ var g_UnitActions = Engine.GuiInterfaceCall("PlaySound", { "name": "order_patrol", - "entity": selection[0] + "entity": action.firstAbleEntity }); return true; }, @@ -298,7 +298,7 @@ var g_UnitActions = Engine.GuiInterfaceCall("PlaySound", { "name": "order_heal", - "entity": selection[0] + "entity": action.firstAbleEntity }); return true; @@ -363,7 +363,7 @@ var g_UnitActions = Engine.GuiInterfaceCall("PlaySound", { "name": action.foundation ? "order_build" : "order_repair", - "entity": selection[0] + "entity": action.firstAbleEntity }); return true; @@ -420,7 +420,7 @@ var g_UnitActions = Engine.GuiInterfaceCall("PlaySound", { "name": "order_gather", - "entity": selection[0] + "entity": action.firstAbleEntity }); return true; @@ -470,7 +470,7 @@ var g_UnitActions = Engine.GuiInterfaceCall("PlaySound", { "name": "order_gather", - "entity": selection[0] + "entity": action.firstAbleEntity }); return true; @@ -579,7 +579,7 @@ var g_UnitActions = Engine.GuiInterfaceCall("PlaySound", { "name": "order_trade", - "entity": selection[0] + "entity": action.firstAbleEntity }); return true; @@ -679,7 +679,7 @@ var g_UnitActions = Engine.GuiInterfaceCall("PlaySound", { "name": "order_garrison", - "entity": selection[0] + "entity": action.firstAbleEntity }); return true; @@ -751,7 +751,7 @@ var g_UnitActions = Engine.GuiInterfaceCall("PlaySound", { "name": "order_guard", - "entity": selection[0] + "entity": action.firstAbleEntity }); return true; @@ -804,7 +804,7 @@ var g_UnitActions = Engine.GuiInterfaceCall("PlaySound", { "name": "order_guard", - "entity": selection[0] + "entity": action.firstAbleEntity }); return true;