Let hedgehog position be taken from config, still more work is needed
authorunc0rr
Fri, 21 Sep 2007 21:51:48 +0000
changeset 604 2f1165467a66
parent 603 d7877468653b
child 605 2651c3fe4567
Let hedgehog position be taken from config, still more work is needed
QTfrontend/game.cpp
hedgewars/CCHandlers.inc
hedgewars/uConsole.pas
hedgewars/uGears.pas
share/hedgewars/Data/Trainings/001_Shotgun.txt
--- a/QTfrontend/game.cpp	Fri Sep 21 19:18:06 2007 +0000
+++ b/QTfrontend/game.cpp	Fri Sep 21 21:51:48 2007 +0000
@@ -128,7 +128,7 @@
 	HWTeam team1(0);
 	team1.difficulty = 0;
 	team1.teamColor = QColor(65535);
-	team1.numHedgehogs = 4;
+	team1.numHedgehogs = 1;
 	HWProto::addStringListToBuffer(teamscfg,
 			team1.TeamGameConfig(100));
 
--- a/hedgewars/CCHandlers.inc	Fri Sep 21 19:18:06 2007 +0000
+++ b/hedgewars/CCHandlers.inc	Fri Sep 21 21:51:48 2007 +0000
@@ -118,6 +118,18 @@
      end
 end;
 
+procedure chSetHHCoords(var x: shortstring);
+var y: shortstring;
+    t: Longint;
+begin
+if (not isDeveloperMode) or (CurrentHedgehog = nil) or (CurrentHedgehog^.Gear = nil) then exit;
+SplitBySpace(x, y);
+val(x, t);
+CurrentHedgehog^.Gear^.X:= int2hwFloat(t);
+val(y, t);
+CurrentHedgehog^.Gear^.Y:= int2hwFloat(t)
+end;
+
 procedure chAddAmmoStore(var descr: shortstring);
 begin
 AddAmmoStore(descr)
--- a/hedgewars/uConsole.pas	Fri Sep 21 19:18:06 2007 +0000
+++ b/hedgewars/uConsole.pas	Fri Sep 21 21:51:48 2007 +0000
@@ -295,6 +295,7 @@
 RegisterVariable('grave'   , vtCommand, @chGrave        , false);
 RegisterVariable('bind'    , vtCommand, @chBind         , true );
 RegisterVariable('addhh'   , vtCommand, @chAddHH        , false);
+RegisterVariable('hhcoords', vtCommand, @chSetHHCoords  , false);
 RegisterVariable('ammstore', vtCommand, @chAddAmmoStore , false);
 RegisterVariable('skip'    , vtCommand, @chSkip         , false);
 RegisterVariable('say'     , vtCommand, @chSay          , true );
--- a/hedgewars/uGears.pas	Fri Sep 21 19:18:06 2007 +0000
+++ b/hedgewars/uGears.pas	Fri Sep 21 21:51:48 2007 +0000
@@ -798,7 +798,7 @@
       begin
       for i:= 0 to cMaxHHIndex do
           with Hedgehogs[i] do
-               if Gear <> nil then FindPlace(Gear, false, t, t + 1024);
+               if (Gear <> nil) and (Gear^.X.QWordValue = 0) then FindPlace(Gear, false, t, t + 1024);
       inc(t, 1024);
       end
    end else // mix hedgehogs
@@ -809,7 +809,7 @@
       begin
       for i:= 0 to cMaxHHIndex do
           with Hedgehogs[i] do
-               if Gear <> nil then
+               if (Gear <> nil) and (Gear^.X.QWordValue = 0) then
                   begin
                   ar[Count]:= Gear;
                   inc(Count)
--- a/share/hedgewars/Data/Trainings/001_Shotgun.txt	Fri Sep 21 19:18:06 2007 +0000
+++ b/share/hedgewars/Data/Trainings/001_Shotgun.txt	Fri Sep 21 21:51:48 2007 +0000
@@ -1,3 +1,4 @@
+ehhcoords 1500 310
 eaddtrig s2147483649 1 1 33 1100 -100 1
 eaddtrig s1 1 1 33 1200 -100 2
 eaddtrig s2 1 1 33 1300 -100 3