hedgewars/uScript.pas
changeset 14537 ce40351e0690
parent 14536 181509fe1ae8
child 14598 62dea281e4d5
--- a/hedgewars/uScript.pas	Thu Jan 10 02:50:01 2019 +0100
+++ b/hedgewars/uScript.pas	Thu Jan 10 03:14:02 2019 +0100
@@ -2300,7 +2300,13 @@
         ParseCommand('fort ' + lua_tostring(L, 4), true, true);
         ParseCommand('voicepack ' + lua_tostring(L, 5), true, true);
         if (np = 6) then ParseCommand('flag ' + lua_tostring(L, 6), true, true);
-        CurrentTeam^.Binds:= DefaultBinds;
+        // If there's a mission team, copy it's control scheme.
+        // So in singleplayer missions, all teams use the player team's controls.
+        if MissionTeam <> nil then
+            CurrentTeam^.Binds:= MissionTeam^.Binds
+        // Default keys otherwise
+        else
+            CurrentTeam^.Binds:= DefaultBinds;
         // push team name and index
         lua_pushstring(L, str2pchar(CurrentTeam^.TeamName));
         lua_pushnumber(L, TeamsCount - 1);