Support 'Divide teams' option in engine
authorunc0rr
Sun, 26 Oct 2008 17:41:03 +0000
changeset 1428 0855275d443f
parent 1427 b510f7a74ef6
child 1429 24ae7a81aa03
Support 'Divide teams' option in engine
QTfrontend/gamecfgwidget.cpp
hedgewars/uConsts.pas
hedgewars/uGears.pas
hedgewars/uLand.pas
--- a/QTfrontend/gamecfgwidget.cpp	Sun Oct 26 17:39:33 2008 +0000
+++ b/QTfrontend/gamecfgwidget.cpp	Sun Oct 26 17:41:03 2008 +0000
@@ -86,9 +86,9 @@
 	quint32 result = 0;
 
 	if (CB_mode_Forts->isChecked())
-		result |= 1;
+		result |= 0x01;
 	if (CB_teamsDivide->isChecked())
-		result |= 1;
+		result |= 0x10;
 
 	return result;
 }
--- a/hedgewars/uConsts.pas	Sun Oct 26 17:39:33 2008 +0000
+++ b/hedgewars/uConsts.pas	Sun Oct 26 17:41:03 2008 +0000
@@ -171,6 +171,7 @@
 	gfForts       = $00000001;
 	gfMultiWeapon = $00000002;
 	gfSolidLand   = $00000004;
+	gfDivideTeams = $00000010;
 	gfOneClanMode = $10000000;
 
 	gstDrowning       = $00000001;
--- a/hedgewars/uGears.pas	Sun Oct 26 17:39:33 2008 +0000
+++ b/hedgewars/uGears.pas	Sun Oct 26 17:41:03 2008 +0000
@@ -1262,9 +1262,10 @@
     ar: array[0..Pred(cMaxHHs)] of PGear;
     Count: Longword;
 begin
-if (GameFlags and gfForts) <> 0 then
+if (GameFlags and (gfForts or gfDivideTeams)) <> 0 then
 	begin
 	t:= 0;
+	TryDo(ClansCount = 2, 'More or less than 2 clans on map in divided teams mode!', true);
 	for p:= 0 to 1 do
 		begin
 		with ClansArray[p]^ do
--- a/hedgewars/uLand.pas	Sun Oct 26 17:39:33 2008 +0000
+++ b/hedgewars/uLand.pas	Sun Oct 26 17:41:03 2008 +0000
@@ -551,7 +551,6 @@
 var tmpsurf: PSDL_Surface;
 begin
 WriteLnToConsole('Generating forts land...');
-TryDo(ClansCount = 2, 'More or less than 2 clans on map in forts mode!', true);
 
 tmpsurf:= LoadImage(Pathz[ptForts] + '/' + ClansArray[0]^.Teams[0]^.FortName + 'L', true, true, true);
 BlitImageAndGenerateCollisionInfo(0, 0, 1024, tmpsurf);