# HG changeset patch # User unc0rr # Date 1270396279 0 # Node ID 397a8f048bb354aad62b02bf5a4f4b01ac8e0c0e # Parent 0973c5af51413ad0382e38aed1aed6f95c73d245 with this patch I'm unable to make rope stuck in land diff -r 0973c5af5141 -r 397a8f048bb3 CMakeLists.txt --- a/CMakeLists.txt Sun Apr 04 14:47:45 2010 +0000 +++ b/CMakeLists.txt Sun Apr 04 15:51:19 2010 +0000 @@ -30,7 +30,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR "0") set(CPACK_PACKAGE_VERSION_MINOR "9") -set(CPACK_PACKAGE_VERSION_PATCH "13${version_suffix}") +set(CPACK_PACKAGE_VERSION_PATCH "14${version_suffix}") #forbid in-tree building #IF (${CMAKE_SOURCE_DIR} MATCHES ${CMAKE_BINARY_DIR}) @@ -152,7 +152,7 @@ set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") -set(HEDGEWARS_PROTO_VER 31) +set(HEDGEWARS_PROTO_VER 32) if(WITH_SERVER) set(HAVE_NETSERVER true) diff -r 0973c5af5141 -r 397a8f048bb3 hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Sun Apr 04 14:47:45 2010 +0000 +++ b/hedgewars/GSHandlers.inc Sun Apr 04 15:51:19 2010 +0000 @@ -1070,7 +1070,7 @@ nx:= ropeDx * len; ny:= ropeDy * len; - len:= Gear^.Elasticity - _0_3x70; + len:= Gear^.Elasticity - _5; while len > _3 do begin lx:= hwRound(Gear^.X + mdX * len); @@ -1108,13 +1108,23 @@ begin tx:= RopePoints.ar[Pred(RopePoints.Count)].X; ty:= RopePoints.ar[Pred(RopePoints.Count)].Y; - if RopePoints.ar[Pred(RopePoints.Count)].b xor ((tx - Gear^.X) * (ty - HHGear^.Y) > (tx - HHGear^.X) * (ty - Gear^.Y)) then + mdX:= tx - Gear^.X; + mdY:= ty - Gear^.Y; + if RopePoints.ar[Pred(RopePoints.Count)].b xor (mdX * (ty - HHGear^.Y) > (tx - HHGear^.X) * mdY) then begin dec(RopePoints.Count); Gear^.X:= RopePoints.ar[RopePoints.Count].X; Gear^.Y:= RopePoints.ar[RopePoints.Count].Y; Gear^.Elasticity:= Gear^.Elasticity + RopePoints.ar[RopePoints.Count].dLen; - Gear^.Friction:= Gear^.Friction + RopePoints.ar[RopePoints.Count].dLen + Gear^.Friction:= Gear^.Friction + RopePoints.ar[RopePoints.Count].dLen; + + // restore hog position + len:= _1 / Distance(mdX, mdY); + mdX:= mdX * len; + mdY:= mdY * len; + + HHGear^.X:= Gear^.X - mdX * Gear^.Elasticity; + HHGear^.Y:= Gear^.Y - mdY * Gear^.Elasticity; end end; diff -r 0973c5af5141 -r 397a8f048bb3 hedgewars/uFloat.pas --- a/hedgewars/uFloat.pas Sun Apr 04 14:47:45 2010 +0000 +++ b/hedgewars/uFloat.pas Sun Apr 04 15:51:19 2010 +0000 @@ -120,7 +120,6 @@ _16: hwFloat = (isNegative: false; QWordValue: 4294967296 * 16); _19: hwFloat = (isNegative: false; QWordValue: 4294967296 * 19); _20: hwFloat = (isNegative: false; QWordValue: 4294967296 * 20); - _0_3x70: hwFloat = (isNegative: false; QWordValue: 1288490189 * 70); _25: hwFloat = (isNegative: false; QWordValue: 4294967296 * 25); _30: hwFloat = (isNegative: false; QWordValue: 4294967296 * 30); _40: hwFloat = (isNegative: false; QWordValue: 4294967296 * 40);