# HG changeset patch # User unc0rr # Date 1163861270 0 # Node ID 07605d2a2024fcdadc29fef0a103a46b4729eedb # Parent 107f7e826a83eea19f2cbb9748cbec8884699a8d - Fix infinite loop when selecting weapon with ammo menu - Play demo with doubleclick - Fix saving team binds :) diff -r 107f7e826a83 -r 07605d2a2024 QTfrontend/game.cpp --- a/QTfrontend/game.cpp Fri Nov 17 13:36:58 2006 +0000 +++ b/QTfrontend/game.cpp Sat Nov 18 14:47:50 2006 +0000 @@ -277,6 +277,7 @@ { QByteArray teamcfg; HWTeam team(teamname); + team.LoadFromFile(); RawSendIPC(HWProto::addStringListToBuffer(teamcfg, team.TeamGameConfig(16776960, 4))); } diff -r 107f7e826a83 -r 07605d2a2024 QTfrontend/hwform.cpp --- a/QTfrontend/hwform.cpp Fri Nov 17 13:36:58 2006 +0000 +++ b/QTfrontend/hwform.cpp Sat Nov 18 14:47:50 2006 +0000 @@ -63,6 +63,7 @@ connect(ui.pagePlayDemo->BtnBack, SIGNAL(clicked()), this, SLOT(GoToMain())); connect(ui.pagePlayDemo->BtnPlayDemo, SIGNAL(clicked()), this, SLOT(PlayDemo())); + connect(ui.pagePlayDemo->DemosList, SIGNAL(doubleClicked (const QModelIndex &)), this, SLOT(PlayDemo())); connect(ui.pageOptions->BtnBack, SIGNAL(clicked()), this, SLOT(GoToMain())); connect(ui.pageOptions->BtnNewTeam, SIGNAL(clicked()), this, SLOT(NewTeam())); diff -r 107f7e826a83 -r 07605d2a2024 QTfrontend/team.cpp --- a/QTfrontend/team.cpp Fri Nov 17 13:36:58 2006 +0000 +++ b/QTfrontend/team.cpp Sat Nov 18 14:47:50 2006 +0000 @@ -182,7 +182,7 @@ Grave = hwform->ui.pageEditTeam->CBGrave->currentText(); Fort = hwform->ui.pageEditTeam->CBFort->currentText(); - for(int i = 0; i < 8; i++) + for(int i = 0; i < BINDS_NUMBER; i++) { binds[i].strbind = hwform->ui.pageEditTeam->CBBind[i]->currentText(); } @@ -194,7 +194,7 @@ sl.push_back("eaddteam"); sl.push_back(QString("ecolor %1").arg(color)); sl.push_back("ename team " + TeamName); - for (int i = 0; i < 8; i++) + for (int i = 0; i < hedgehogs; i++) sl.push_back(QString("ename hh%1 ").arg(i).append(HHName[i])); sl.push_back(QString("egrave " + Grave)); sl.push_back(QString("efort " + Fort)); diff -r 107f7e826a83 -r 07605d2a2024 hedgewars/uTeams.pas --- a/hedgewars/uTeams.pas Fri Nov 17 13:36:58 2006 +0000 +++ b/hedgewars/uTeams.pas Sat Nov 18 14:47:50 2006 +0000 @@ -349,11 +349,16 @@ end; procedure SetWeapon(weap: TAmmoType); +var t: integer; begin +t:= cMaxSlotAmmoIndex; with CurrentTeam^ do with Hedgehogs[CurrHedgehog] do - while Ammo[CurSlot, CurAmmo].AmmoType <> weap do + while (Ammo[CurSlot, CurAmmo].AmmoType <> weap) and (t > 0) do + begin ParseCommand('/slot ' + chr(49 + Ammoz[TAmmoType(weap)].Slot)); + dec(t) + end end; initialization