Fix player team ignoring custom team control scheme in campaign/missions
authorWuzzy <Wuzzy2@mail.ru>
Thu, 10 Jan 2019 02:50:01 +0100
changeset 14536 181509fe1ae8
parent 14535 65780bd056c1
child 14537 ce40351e0690
Fix player team ignoring custom team control scheme in campaign/missions
hedgewars/uScript.pas
hedgewars/uTeams.pas
--- a/hedgewars/uScript.pas	Thu Jan 10 00:41:31 2019 +0100
+++ b/hedgewars/uScript.pas	Thu Jan 10 02:50:01 2019 +0100
@@ -2347,7 +2347,7 @@
         ParseCommand('fort ' + MissionTeam^.FortName, true, true);
         ParseCommand('voicepack ' + MissionTeam^.Voicepack^.name, true, true);
         ParseCommand('flag ' + MissionTeam^.Flag, true, true);
-        CurrentTeam^.Binds:= DefaultBinds;
+        CurrentTeam^.Binds:= MissionTeam^.Binds;
         // push real team name and team index
         lua_pushstring(L, str2pchar(CurrentTeam^.TeamName));
         lua_pushnumber(L, TeamsCount - 1);
--- a/hedgewars/uTeams.pas	Thu Jan 10 00:41:31 2019 +0100
+++ b/hedgewars/uTeams.pas	Thu Jan 10 02:50:01 2019 +0100
@@ -484,6 +484,7 @@
 if checkFails(team <> nil, 'AddTeam: team = nil', true) then exit(nil);
 FillChar(team^, sizeof(TTeam), 0);
 team^.HedgehogsNumber:= 0;
+team^.Binds:= DefaultBinds;
 
 CurrentTeam:= team;
 MissionTeam:= team;
@@ -872,6 +873,7 @@
         begin
         CurrentTeam^.TeamName:= ts;
         CurrentTeam^.PlayerHash:= s;
+        loadTeamBinds(ts);
         CurrentTeam^.voicepack:= AskForVoicepack('Default')
         end
     end