# HG changeset patch # User unc0rr # Date 1179770845 0 # Node ID ba560c17c24cd71033e3801a2f36e4b867572a6f # Parent f682e134ac2e1a33f7b475bfc1d8a1c800cc7ac8 - Don't kick cases by moving hedgehog - Fix hedgehog not registering in collisions array when changing direction without making a step - Fix old rope regression (attaching didn't work properly, when hedgehog is jumping) diff -r f682e134ac2e -r ba560c17c24c hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Mon May 21 15:42:21 2007 +0000 +++ b/hedgewars/GSHandlers.inc Mon May 21 18:07:25 2007 +0000 @@ -643,6 +643,7 @@ Gear^.Y:= Gear^.Y - Gear^.dY; Gear^.Elasticity:= Gear^.Elasticity + _1; HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; +DeleteCI(HHGear); if (HHGear^.State and gstFalling) <> 0 then if TestCollisionYwithGear(HHGear, 1) then begin @@ -662,8 +663,8 @@ ty:= _0; while tt > _20 do begin - if TestCollisionXwithXYShift(Gear, tx, hwRound(ty), hwSign(Gear^.dX)) - or TestCollisionYwithXYShift(Gear, hwRound(tx), hwRound(ty), hwSign(Gear^.dY)) then + if TestCollisionXwithXYShift(Gear, tx, hwRound(ty), -hwSign(Gear^.dX)) + or TestCollisionYwithXYShift(Gear, hwRound(tx), hwRound(ty), -hwSign(Gear^.dY)) then begin Gear^.X:= Gear^.X + tx; Gear^.Y:= Gear^.Y + ty; @@ -672,8 +673,8 @@ with HHGear^ do State:= State and not gstAttacking; tt:= _0 end; - tx:= tx + Gear^.dX - Gear^.dX; - ty:= ty + Gear^.dY - Gear^.dY; + tx:= tx + Gear^.dX + Gear^.dX; + ty:= ty + Gear^.dY + Gear^.dY; tt:= tt - _2; end; end; @@ -987,6 +988,7 @@ begin HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; HHGear^.State:= HHGear^.State and not gstAttacking; +DeleteCI(HHGear); inc(Gear^.Timer); diff -r f682e134ac2e -r ba560c17c24c hedgewars/HHHandlers.inc --- a/hedgewars/HHHandlers.inc Mon May 21 15:42:21 2007 +0000 +++ b/hedgewars/HHHandlers.inc Mon May 21 18:07:25 2007 +0000 @@ -183,10 +183,11 @@ PrevdX:= hwSign(Gear^.dX); if (Gear^.Message and gm_Left )<>0 then Gear^.dX:= -cLittle else if (Gear^.Message and gm_Right )<>0 then Gear^.dX:= cLittle else exit; - DeleteCI(Gear); StepTicks:= cHHStepTicks; if PrevdX <> hwSign(Gear^.dX) then exit; + DeleteCI(Gear); // after exit!! ^^^^ + PHedgehog(Gear^.Hedgehog)^.visStepPos:= (PHedgehog(Gear^.Hedgehog)^.visStepPos + 1) and 7; if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then begin diff -r f682e134ac2e -r ba560c17c24c hedgewars/uCollisions.pas --- a/hedgewars/uCollisions.pas Mon May 21 15:42:21 2007 +0000 +++ b/hedgewars/uCollisions.pas Mon May 21 18:07:25 2007 +0000 @@ -191,7 +191,7 @@ end; TestCollisionXKick:= false; -if flag then +if flag and (Gear^.dX > cHHKick) then begin if Count = 0 then exit; mx:= hwRound(Gear^.X); @@ -201,7 +201,8 @@ with cinfos[i] do if (Gear <> cGear) and (sqr(mx - x) + sqr(my - y) <= sqr(Radius + Gear^.Radius)) and - ((mx > x) xor (Dir > 0)) then // FIXME: Check Gear.Kind + ((mx > x) xor (Dir > 0)) then + if (cinfos[i].cGear^.Kind in [gtHedgehog, gtMine]) then begin Gear^.dX:= Gear^.dX {* _0_6}; Gear^.dY:= Gear^.dY {* _0_6}; @@ -214,7 +215,7 @@ end; DeleteCI(cinfos[i].cGear); exit - end + end else exit(true) end end; @@ -240,7 +241,7 @@ end; TestCollisionYKick:= false; -if flag then +if flag and (Gear^.dX > cHHKick) then begin if Count = 0 then exit; mx:= hwRound(Gear^.X); @@ -251,9 +252,10 @@ if (Gear <> cGear) and (sqr(mx - x) + sqr(my - y) <= sqr(Radius + Gear^.Radius)) and ((my > y) xor (Dir > 0)) then + if (cinfos[i].cGear^.Kind in [gtHedgehog, gtMine]) then begin - Gear^.dX:= Gear^.dX * _0_6; - Gear^.dY:= Gear^.dY * _0_6; + Gear^.dX:= Gear^.dX {* _0_6}; + Gear^.dY:= Gear^.dY {* _0_6}; with cinfos[i].cGear^ do begin dX:= Gear^.dX {* _1_5}; @@ -263,7 +265,7 @@ end; DeleteCI(cinfos[i].cGear); exit - end + end else exit(true) end end;