Fix water rising too fast
authorunc0rr
Sun, 12 Oct 2008 16:31:23 +0000
changeset 1343 7a47a80b20ad
parent 1342 ae6c4f10ace2
child 1344 4004e597f1bf
Fix water rising too fast
QTfrontend/hwform.cpp
hedgewars/GSHandlers.inc
hedgewars/uGears.pas
--- a/QTfrontend/hwform.cpp	Fri Oct 10 13:19:05 2008 +0000
+++ b/QTfrontend/hwform.cpp	Sun Oct 12 16:31:23 2008 +0000
@@ -258,20 +258,23 @@
 void HWForm::OnPageShown(quint8 id, quint8 lastid)
 {
 	if (id == ID_PAGE_MULTIPLAYER || id == ID_PAGE_NETCFG) {
-		QStringList tmNames=config->GetTeamsList();
+		QStringList tmNames = config->GetTeamsList();
 		TeamSelWidget* curTeamSelWidget;
+		
 		if(id == ID_PAGE_MULTIPLAYER) {
-		  curTeamSelWidget=ui.pageMultiplayer->teamsSelect;
+		  curTeamSelWidget = ui.pageMultiplayer->teamsSelect;
 		} else {
-		  curTeamSelWidget=ui.pageNetGame->pNetTeamsWidget;
+		  curTeamSelWidget = ui.pageNetGame->pNetTeamsWidget;
 		}
+		
 		QList<HWTeam> teamsList;
-		for(QStringList::iterator it=tmNames.begin(); it!=tmNames.end(); it++) {
+		for(QStringList::iterator it = tmNames.begin(); it != tmNames.end(); it++) {
 		  HWTeam team(*it);
 		  team.LoadFromFile();
 		  teamsList.push_back(team);
 		}
-		if(lastid==ID_PAGE_SETUP) { // _TEAM
+		
+		if(lastid == ID_PAGE_SETUP) { // _TEAM
 		  if (editedTeam) {
 		    curTeamSelWidget->addTeam(*editedTeam);
 		  }
@@ -553,7 +556,7 @@
 
 void HWForm::StartMPGame()
 {
-	QString ammo=ui.pageSelectWeapon->pWeapons->getWeaponsString(ui.pageMultiplayer->gameCFG->WeaponsName->currentText());
+	QString ammo = ui.pageSelectWeapon->pWeapons->getWeaponsString(ui.pageMultiplayer->gameCFG->WeaponsName->currentText());
 
 	CreateGame(ui.pageMultiplayer->gameCFG, ui.pageMultiplayer->teamsSelect, ammo);
 
--- a/hedgewars/GSHandlers.inc	Fri Oct 10 13:19:05 2008 +0000
+++ b/hedgewars/GSHandlers.inc	Sun Oct 12 16:31:23 2008 +0000
@@ -1773,6 +1773,6 @@
 	end;
 
 inc(Gear^.Tag);
-if (Gear^.Tag = 51) or (cWaterLine = 0) then
+if (Gear^.Tag = 47) or (cWaterLine = 0) then
 	DeleteGear(Gear)
 end;
--- a/hedgewars/uGears.pas	Fri Oct 10 13:19:05 2008 +0000
+++ b/hedgewars/uGears.pas	Sun Oct 12 16:31:23 2008 +0000
@@ -453,85 +453,86 @@
       end;
 
 if AllInactive then
-   case step of
-        stDelay: begin
-                 if delay = 0 then
-                    delay:= cInactDelay
-                 else
-                    dec(delay);
+case step of
+	stDelay: begin
+		if delay = 0 then
+			delay:= cInactDelay
+		else
+			dec(delay);
 
-                 if delay = 0 then
-                    inc(step)
-                 end;
-        stChDmg: if CheckNoDamage then inc(step) else step:= stDelay;
-    stTurnReact: begin
-                 if (not bBetweenTurns) and (not isInMultiShoot) then
-                    begin
-                    uStats.TurnReaction;
-                    inc(step)
-                    end else
-                    inc(step, 2);
-                 end;
-   stAfterDelay: begin
-                 if delay = 0 then
-                    delay:= cInactDelay
-                 else
-                    dec(delay);
+		if delay = 0 then
+			inc(step)
+		end;
+	stChDmg: if CheckNoDamage then inc(step) else step:= stDelay;
+	stTurnReact: begin
+		if (not bBetweenTurns) and (not isInMultiShoot) then
+			begin
+			uStats.TurnReaction;
+			inc(step)
+		end else
+			inc(step, 2);
+		end;
+	stAfterDelay: begin
+		if delay = 0 then
+			delay:= cInactDelay
+		else
+			dec(delay);
 
-                 if delay = 0 then
-                    inc(step)
-                 end;
-        stChWin: begin
-                 CheckForWin;
-                 inc(step)
-                 end;
-        stWater: begin
-                 if TotalRounds = 17 then bWaterRising:= true;
+		if delay = 0 then
+		inc(step)
+		end;
+	stChWin: begin
+			CheckForWin;
+			inc(step)
+			end;
+	stWater: if (not bBetweenTurns) and (not isInMultiShoot) then
+				begin
+				if TotalRounds = 17 then bWaterRising:= true;
 
-                 if bWaterRising then
-                    AddGear(0, 0, gtWaterUp, 0, _0, _0, 0);
+				if bWaterRising then
+				AddGear(0, 0, gtWaterUp, 0, _0, _0, 0);
 
-                 inc(step)
-                 end;
-       stChWin2: begin
-                 CheckForWin;
-                 inc(step)
-                 end;
-       stHealth: begin
-                 if (TotalRounds = 15) and (cHealthDecrease = 0) then
-                    begin
-                    cHealthDecrease:= 5;
-                    AddCaption(trmsg[sidSuddenDeath], $FFFFFF, capgrpGameState)
-                    end;
+				inc(step)
+				end else inc(step);
+	stChWin2: begin
+			CheckForWin;
+			inc(step)
+			end;
+	stHealth: begin
+			if (TotalRounds = 15) and (cHealthDecrease = 0) then
+				begin
+				cHealthDecrease:= 5;
+				AddCaption(trmsg[sidSuddenDeath], $FFFFFF, capgrpGameState)
+				end;
 
-                 if (cHealthDecrease = 0)
-                   or bBetweenTurns
-                   or isInMultiShoot
-                   or (TotalRounds = 0) then inc(step)
-                    else begin
-                    bBetweenTurns:= true;
-                    HealthMachine;
-                    step:= stChDmg
-                    end
-                 end;
-        stSpawn: begin
-                 if not isInMultiShoot then SpawnBoxOfSmth;
-                 inc(step)
-                 end;
-        stNTurn: begin
-                 if isInMultiShoot then isInMultiShoot:= false
-                    else begin
-                    ParseCommand('/nextturn', true);
-                    SwitchHedgehog;
+			if (cHealthDecrease = 0)
+				or bBetweenTurns
+				or isInMultiShoot
+				or (TotalRounds = 0) then inc(step)
+			else begin
+				bBetweenTurns:= true;
+				HealthMachine;
+				step:= stChDmg
+				end
+			end;
+	stSpawn: begin
+			if not isInMultiShoot then SpawnBoxOfSmth;
+			inc(step)
+			end;
+	stNTurn: begin
+			if isInMultiShoot then isInMultiShoot:= false
+			else begin
+			ParseCommand('/nextturn', true);
+			SwitchHedgehog;
 
-                    inc(step);
+			inc(step);
 
-                    AfterSwitchHedgehog;
-                    bBetweenTurns:= false
-                    end;
-                 step:= Low(step)
-                 end;
-        end;
+			AfterSwitchHedgehog;
+			bBetweenTurns:= false
+			end;
+			step:= Low(step)
+			end;
+	end;
 
 if TurnTimeLeft > 0 then
 		if CurrentHedgehog^.Gear <> nil then