- Fix blowtorch regression
authorunc0rr
Sun, 21 Dec 2008 18:26:28 +0000
changeset 1547 4251f9598d54
parent 1546 2bd33f2287cc
child 1548 682c0c968997
- Fix blowtorch regression - Some work on rope
doc/SoundsMapping.txt
hedgewars/GSHandlers.inc
--- a/doc/SoundsMapping.txt	Thu Dec 18 17:47:18 2008 +0000
+++ b/doc/SoundsMapping.txt	Sun Dec 21 18:26:28 2008 +0000
@@ -20,7 +20,7 @@
  + ill get you - said after taking a medium amount of damage
  + Incoming - on airstrike
 Just you wait - said after your team takes a certain amount of damage
-Kamikaze - when your hedgehog uses the as yet nonexistant kamikaze weapon
+ + Kamikaze - when your hedgehog uses the as yet nonexistant kamikaze weapon
  + laugh - used when your hedgehog blows himself up Near an enemy hedgehog
 leave me alone - when a hedgehog is being picked on / hit a certain amount of times in a row
  + Missed - when enemy misses
--- a/hedgewars/GSHandlers.inc	Thu Dec 18 17:47:18 2008 +0000
+++ b/hedgewars/GSHandlers.inc	Sun Dec 21 18:26:28 2008 +0000
@@ -571,9 +571,9 @@
 	begin
 	b:= true;
 	if Gear^.dX.isNegative then
-		HHGear^.Message:= (HHGear^.Message and gm_Attack) or gm_Left
+		HHGear^.Message:= (HHGear^.Message and (gm_Attack or gm_Up or gm_Down)) or gm_Left
 	else
-		HHGear^.Message:= (HHGear^.Message and gm_Attack) or gm_Right;
+		HHGear^.Message:= (HHGear^.Message and (gm_Attack or gm_Up or gm_Down)) or gm_Right;
 
 	if ((HHGear^.State and gstMoving) = 0) then
 		begin
@@ -628,7 +628,7 @@
 procedure doStepRopeWork(Gear: PGear);
 const flCheck: boolean = false;
 var HHGear: PGear;
-	len, cs, cc, tx, ty, nx, ny: hwFloat;
+	len, cs, cc, tx, ty, nx, ny, ropeDx, ropeDy: hwFloat;
 	lx, ly: LongInt;
 
 	procedure DeleteMe;
@@ -651,16 +651,16 @@
 	exit
 	end;
 
-Gear^.dX:= HHGear^.X - Gear^.X;
-Gear^.dY:= HHGear^.Y - Gear^.Y;
+ropeDx:= HHGear^.X - Gear^.X; // vector between hedgehog and rope attaching point
+ropeDy:= HHGear^.Y - Gear^.Y;
 
 if (Gear^.Message and gm_Left  <> 0) then HHGear^.dX:= HHGear^.dX - _0_0002 else
 if (Gear^.Message and gm_Right <> 0) then HHGear^.dX:= HHGear^.dX + _0_0002;
 
 if not TestCollisionYwithGear(HHGear, 1) then HHGear^.dY:= HHGear^.dY + cGravity;
 
-cs:= Gear^.dY + HHGear^.dY;
-cc:= Gear^.dX + HHGear^.dX;
+cc:= ropeDx + HHGear^.dX;
+cs:= ropeDy + HHGear^.dY;
 len:= _1 / Distance(cc, cs);
 cc:= cc * len; // rope vector plus hedgehog direction vector normalized
 cs:= cs * len;
@@ -696,7 +696,7 @@
 				Gear^.Friction:= Gear^.Friction - len;
 				break
 				end;
-			len:= len - _0_5
+			len:= len - _3
 			end;
 	end else
 	if RopePoints.Count > 0 then // check whether the last dividing point could be removed