hedgewars/uGearsHandlersRope.pas
author nemo
Fri, 29 Mar 2013 08:03:17 -0400
changeset 8812 fdac638c6f9a
parent 8751 4609823efc94
child 9080 9b42757d7e71
permissions -rw-r--r--
oups. reused same variable twice. my bad. You know, maybe somewhere in uVariables or uGearsList should define what we use Gear variables for in each gear
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7660
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
     1
(*
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
     2
 * Hedgewars, a free turn based strategy game
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
     3
 * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com>
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
     4
 *
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
     8
 *
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    12
 * GNU General Public License for more details.
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    13
 *
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    14
 * You should have received a copy of the GNU General Public License
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    15
 * along with this program; if not, write to the Free Software
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    17
 *)
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    18
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    19
{$INCLUDE "options.inc"}
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    20
unit uGearsHandlersRope;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    21
interface
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    22
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    23
uses uTypes;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    24
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    25
procedure doStepRope(Gear: PGear);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    26
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    27
implementation
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    28
uses uConsts, uFloat, uCollisions, uVariables, uGearsList, uSound, uGearsUtils,
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    29
    uAmmos, uDebug, uUtils, uGearsHedgehog, uGearsRender;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    30
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    31
procedure doStepRopeAfterAttack(Gear: PGear);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    32
var 
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    33
    HHGear: PGear;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    34
begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    35
    HHGear := Gear^.Hedgehog^.Gear;
8680
5fe344cc8610 prevent an old abuse of parachute to land safely
nemo
parents: 8468
diff changeset
    36
    if (HHGear^.Hedgehog^.CurAmmoType = amParachute) and (HHGear^.dY > _0_39) then
5fe344cc8610 prevent an old abuse of parachute to land safely
nemo
parents: 8468
diff changeset
    37
        begin
5fe344cc8610 prevent an old abuse of parachute to land safely
nemo
parents: 8468
diff changeset
    38
        DeleteGear(Gear);
5fe344cc8610 prevent an old abuse of parachute to land safely
nemo
parents: 8468
diff changeset
    39
        ApplyAmmoChanges(HHGear^.Hedgehog^);
5fe344cc8610 prevent an old abuse of parachute to land safely
nemo
parents: 8468
diff changeset
    40
        HHGear^.Message:= HHGear^.Message or gmLJump;
5fe344cc8610 prevent an old abuse of parachute to land safely
nemo
parents: 8468
diff changeset
    41
        exit
5fe344cc8610 prevent an old abuse of parachute to land safely
nemo
parents: 8468
diff changeset
    42
        end;
5fe344cc8610 prevent an old abuse of parachute to land safely
nemo
parents: 8468
diff changeset
    43
7660
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    44
    if ((HHGear^.State and gstHHDriven) = 0)
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    45
    or (CheckGearDrowning(HHGear))
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    46
    or (TestCollisionYwithGear(HHGear, 1) <> 0) then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    47
        begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    48
        DeleteGear(Gear);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    49
        isCursorVisible := false;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    50
        ApplyAmmoChanges(HHGear^.Hedgehog^);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    51
        exit
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    52
        end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    53
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    54
    HedgehogChAngle(HHGear);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    55
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    56
    if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    57
        SetLittle(HHGear^.dX);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    58
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    59
    if HHGear^.dY.isNegative and (TestCollisionYwithGear(HHGear, -1) <> 0) then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    60
        HHGear^.dY := _0;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    61
    HHGear^.X := HHGear^.X + HHGear^.dX;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    62
    HHGear^.Y := HHGear^.Y + HHGear^.dY;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    63
    HHGear^.dY := HHGear^.dY + cGravity;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    64
    
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    65
    if (GameFlags and gfMoreWind) <> 0 then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    66
        HHGear^.dX := HHGear^.dX + cWindSpeed / HHGear^.Density;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    67
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    68
    if (Gear^.Message and gmAttack) <> 0 then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    69
        begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    70
        Gear^.X := HHGear^.X;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    71
        Gear^.Y := HHGear^.Y;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    72
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    73
        ApplyAngleBounds(Gear^.Hedgehog^, amRope);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    74
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    75
        Gear^.dX := SignAs(AngleSin(HHGear^.Angle), HHGear^.dX);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    76
        Gear^.dY := -AngleCos(HHGear^.Angle);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    77
        Gear^.Friction := _4_5 * cRopePercent;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    78
        Gear^.Elasticity := _0;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    79
        Gear^.State := Gear^.State and (not gsttmpflag);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    80
        Gear^.doStep := @doStepRope;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    81
        end
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    82
end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    83
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    84
procedure RopeDeleteMe(Gear, HHGear: PGear);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    85
begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    86
    with HHGear^ do
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    87
        begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    88
        Message := Message and (not gmAttack);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    89
        State := (State or gstMoving) and (not gstWinner);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    90
        end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    91
    DeleteGear(Gear)
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    92
end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    93
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    94
procedure RopeWaitCollision(Gear, HHGear: PGear);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    95
begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    96
    with HHGear^ do
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    97
        begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    98
        Message := Message and (not gmAttack);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
    99
        State := State or gstMoving;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   100
        end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   101
    RopePoints.Count := 0;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   102
    Gear^.Elasticity := _0;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   103
    Gear^.doStep := @doStepRopeAfterAttack
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   104
end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   105
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   106
procedure doStepRopeWork(Gear: PGear);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   107
var 
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   108
    HHGear: PGear;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   109
    len, tx, ty, nx, ny, ropeDx, ropeDy, mdX, mdY: hwFloat;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   110
    lx, ly, cd: LongInt;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   111
    haveCollision,
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   112
    haveDivided: boolean;
8733
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   113
    wrongSide: boolean;
7660
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   114
begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   115
    if GameTicks mod 4 <> 0 then exit;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   116
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   117
    HHGear := Gear^.Hedgehog^.Gear;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   118
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   119
    if ((HHGear^.State and gstHHDriven) = 0)
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   120
       or (CheckGearDrowning(HHGear)) or (Gear^.PortalCounter <> 0) then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   121
        begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   122
        PlaySound(sndRopeRelease);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   123
        RopeDeleteMe(Gear, HHGear);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   124
        exit
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   125
        end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   126
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   127
    HHGear^.dX.QWordValue:= HHGear^.dX.QWordValue shl 2;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   128
    HHGear^.dY.QWordValue:= HHGear^.dY.QWordValue shl 2;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   129
    if (Gear^.Message and gmLeft  <> 0) and (not TestCollisionXwithGear(HHGear, -1)) then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   130
        HHGear^.dX := HHGear^.dX - _0_0032;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   131
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   132
    if (Gear^.Message and gmRight <> 0) and (not TestCollisionXwithGear(HHGear,  1)) then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   133
        HHGear^.dX := HHGear^.dX + _0_0032;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   134
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   135
    // vector between hedgehog and rope attaching point
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   136
    ropeDx := HHGear^.X - Gear^.X;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   137
    ropeDy := HHGear^.Y - Gear^.Y;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   138
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   139
    if TestCollisionYwithGear(HHGear, 1) = 0 then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   140
        begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   141
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   142
        // depending on the rope vector we know which X-side to check for collision
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   143
        // in order to find out if the hog can still be moved by gravity
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   144
        if ropeDx.isNegative = RopeDy.IsNegative then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   145
            cd:= -1
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   146
        else
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   147
            cd:= 1;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   148
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   149
        // apply gravity if there is no obstacle
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   150
        if not TestCollisionXwithGear(HHGear, cd) then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   151
            HHGear^.dY := HHGear^.dY + cGravity * 16;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   152
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   153
        if (GameFlags and gfMoreWind) <> 0 then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   154
            // apply wind if there's no obstacle
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   155
            if not TestCollisionXwithGear(HHGear, hwSign(cWindSpeed)) then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   156
                HHGear^.dX := HHGear^.dX + cWindSpeed * 16 / HHGear^.Density;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   157
        end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   158
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   159
    mdX := ropeDx + HHGear^.dX;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   160
    mdY := ropeDy + HHGear^.dY;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   161
    len := _1 / Distance(mdX, mdY);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   162
    // rope vector plus hedgehog direction vector normalized
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   163
    mdX := mdX * len;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   164
    mdY := mdY * len;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   165
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   166
    // for visual purposes only
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   167
    Gear^.dX := mdX;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   168
    Gear^.dY := mdY;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   169
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   170
    /////
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   171
    tx := HHGear^.X;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   172
    ty := HHGear^.Y;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   173
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   174
    if ((Gear^.Message and gmDown) <> 0) and (Gear^.Elasticity < Gear^.Friction) then
8468
71159aa7172f trying to prevent sticking. PS. code is hard to read when drunk.
nemo
parents: 8462
diff changeset
   175
        if not (TestCollisionXwithGear(HHGear, hwSign(ropeDx))
8462
19b1de9423ab this might possibly appease the shoppa players
nemo
parents: 8397
diff changeset
   176
        or ((ropeDy.QWordValue <> 0) and TestCollisionYwithXYShift(HHGear, 0, 1, hwSign(ropeDy)))) then
7660
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   177
            Gear^.Elasticity := Gear^.Elasticity + _1_2;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   178
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   179
    if ((Gear^.Message and gmUp) <> 0) and (Gear^.Elasticity > _30) then
8468
71159aa7172f trying to prevent sticking. PS. code is hard to read when drunk.
nemo
parents: 8462
diff changeset
   180
        if not (TestCollisionXwithGear(HHGear, -hwSign(ropeDx))
8462
19b1de9423ab this might possibly appease the shoppa players
nemo
parents: 8397
diff changeset
   181
        or ((ropeDy.QWordValue <> 0) and TestCollisionYwithXYShift(HHGear, 0, 1, -hwSign(ropeDy)))) then
7660
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   182
            Gear^.Elasticity := Gear^.Elasticity - _1_2;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   183
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   184
    HHGear^.X := Gear^.X + mdX * Gear^.Elasticity;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   185
    HHGear^.Y := Gear^.Y + mdY * Gear^.Elasticity;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   186
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   187
    HHGear^.dX := HHGear^.X - tx;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   188
    HHGear^.dY := HHGear^.Y - ty;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   189
    ////
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   190
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   191
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   192
    haveDivided := false;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   193
    // check whether rope needs dividing
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   194
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   195
    len := Gear^.Elasticity - _5;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   196
    nx := Gear^.X + mdX * len;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   197
    ny := Gear^.Y + mdY * len;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   198
    tx := mdX * _1_2; // should be the same as increase step
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   199
    ty := mdY * _1_2;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   200
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   201
    while len > _3 do
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   202
        begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   203
        lx := hwRound(nx);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   204
        ly := hwRound(ny);
8751
4609823efc94 More flagging of Land values. Also use less than for tests of non-terrain, instead of "and $FF00 = 0". Saves a couple of ops, which actually matters a small amount in a few places.
nemo
parents: 8744
diff changeset
   205
        if ((ly and LAND_HEIGHT_MASK) = 0) and ((lx and LAND_WIDTH_MASK) = 0) and (Land[ly, lx] > lfAllObjMask) then
7660
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   206
            begin
8397
5b273af3ac95 Don't use same hwFloat variable at both left and right sides of assignment (inlining bug?)
unc0rr
parents: 7674
diff changeset
   207
            tx := _1 / Distance(ropeDx, ropeDy);
7660
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   208
            // old rope pos
8397
5b273af3ac95 Don't use same hwFloat variable at both left and right sides of assignment (inlining bug?)
unc0rr
parents: 7674
diff changeset
   209
            nx := ropeDx * tx;
5b273af3ac95 Don't use same hwFloat variable at both left and right sides of assignment (inlining bug?)
unc0rr
parents: 7674
diff changeset
   210
            ny := ropeDy * tx;
7660
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   211
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   212
            with RopePoints.ar[RopePoints.Count] do
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   213
                begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   214
                X := Gear^.X;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   215
                Y := Gear^.Y;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   216
                if RopePoints.Count = 0 then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   217
                    RopePoints.HookAngle := DxDy2Angle(Gear^.dY, Gear^.dX);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   218
                b := (nx * HHGear^.dY) > (ny * HHGear^.dX);
8733
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   219
                sx:= Gear^.dX.isNegative;
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   220
                sy:= Gear^.dY.isNegative;
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   221
                sb:= Gear^.dX.QWordValue < Gear^.dY.QWordValue;
7660
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   222
                dLen := len
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   223
                end;
8397
5b273af3ac95 Don't use same hwFloat variable at both left and right sides of assignment (inlining bug?)
unc0rr
parents: 7674
diff changeset
   224
7660
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   225
            with RopePoints.rounded[RopePoints.Count] do
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   226
                begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   227
                X := hwRound(Gear^.X);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   228
                Y := hwRound(Gear^.Y);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   229
                end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   230
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   231
            Gear^.X := Gear^.X + nx * len;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   232
            Gear^.Y := Gear^.Y + ny * len;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   233
            inc(RopePoints.Count);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   234
            TryDo(RopePoints.Count <= MAXROPEPOINTS, 'Rope points overflow', true);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   235
            Gear^.Elasticity := Gear^.Elasticity - len;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   236
            Gear^.Friction := Gear^.Friction - len;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   237
            haveDivided := true;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   238
            break
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   239
            end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   240
        nx := nx - tx;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   241
        ny := ny - ty;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   242
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   243
        // len := len - _1_2 // should be the same as increase step
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   244
        len.QWordValue := len.QWordValue - _1_2.QWordValue;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   245
        end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   246
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   247
    if not haveDivided then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   248
        if RopePoints.Count > 0 then // check whether the last dividing point could be removed
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   249
            begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   250
            tx := RopePoints.ar[Pred(RopePoints.Count)].X;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   251
            ty := RopePoints.ar[Pred(RopePoints.Count)].Y;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   252
            mdX := tx - Gear^.X;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   253
            mdY := ty - Gear^.Y;
8733
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   254
            ropeDx:= tx - HHGear^.X;
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   255
            ropeDy:= ty - HHGear^.Y;
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   256
            if RopePoints.ar[Pred(RopePoints.Count)].b xor (mdX * ropeDy > ropeDx * mdY) then
7660
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   257
                begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   258
                dec(RopePoints.Count);
8733
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   259
                Gear^.X := tx;
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   260
                Gear^.Y := ty;
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   261
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   262
                // oops, opposite quadrant, don't restore hog position in such case, just remove the point
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   263
                wrongSide:= (ropeDx.isNegative = RopePoints.ar[RopePoints.Count].sx)
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   264
                    and (ropeDy.isNegative = RopePoints.ar[RopePoints.Count].sy);
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   265
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   266
                // previous check could be inaccurate in vertical/horizontal rope positions,
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   267
                // so perform this check also, even though odds are 1 to 415927 to hit this
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   268
                if (not wrongSide)
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   269
                    and ((ropeDx.isNegative = RopePoints.ar[RopePoints.Count].sx)
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   270
                      <> (ropeDy.isNegative = RopePoints.ar[RopePoints.Count].sy)) then
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   271
                    if RopePoints.ar[RopePoints.Count].sb then
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   272
                        wrongSide:= ropeDy.isNegative = RopePoints.ar[RopePoints.Count].sy
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   273
                        else
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   274
                        wrongSide:= ropeDx.isNegative = RopePoints.ar[RopePoints.Count].sx;
7660
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   275
8733
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   276
                if wrongSide then
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   277
                    begin
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   278
                    Gear^.Elasticity := Gear^.Elasticity - RopePoints.ar[RopePoints.Count].dLen;
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   279
                    Gear^.Friction := Gear^.Friction - RopePoints.ar[RopePoints.Count].dLen;
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   280
                    end else
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   281
                    begin
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   282
                    Gear^.Elasticity := Gear^.Elasticity + RopePoints.ar[RopePoints.Count].dLen;
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   283
                    Gear^.Friction := Gear^.Friction + RopePoints.ar[RopePoints.Count].dLen;
7660
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   284
8733
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   285
                    // restore hog position
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   286
                    len := _1 / Distance(mdX, mdY);
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   287
                    mdX := mdX * len;
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   288
                    mdY := mdY * len;
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   289
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   290
                    HHGear^.X := Gear^.X - mdX * Gear^.Elasticity;
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   291
                    HHGear^.Y := Gear^.Y - mdY * Gear^.Elasticity;
b6002f1956d5 Hard math to fix issue 571. Well, not really hard math,
unc0rr
parents: 8680
diff changeset
   292
                    end;
7660
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   293
                end
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   294
            end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   295
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   296
    haveCollision := false;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   297
    if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   298
        begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   299
        HHGear^.dX := -_0_6 * HHGear^.dX;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   300
        haveCollision := true
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   301
        end;
8468
71159aa7172f trying to prevent sticking. PS. code is hard to read when drunk.
nemo
parents: 8462
diff changeset
   302
    if TestCollisionYwithXYShift(HHGear, 0, 1, hwSign(HHGear^.dY)) then
7660
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   303
        begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   304
        HHGear^.dY := -_0_6 * HHGear^.dY;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   305
        haveCollision := true
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   306
        end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   307
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   308
    if haveCollision and (Gear^.Message and (gmLeft or gmRight) <> 0) and (Gear^.Message and (gmUp or gmDown) <> 0) then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   309
        begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   310
        HHGear^.dX := SignAs(hwAbs(HHGear^.dX) + _0_8, HHGear^.dX);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   311
        HHGear^.dY := SignAs(hwAbs(HHGear^.dY) + _0_8, HHGear^.dY)
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   312
        end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   313
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   314
    len := hwSqr(HHGear^.dX) + hwSqr(HHGear^.dY);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   315
    if len > _10 then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   316
        begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   317
        len := _3_2 / hwSqrt(len);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   318
        HHGear^.dX := HHGear^.dX * len;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   319
        HHGear^.dY := HHGear^.dY * len;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   320
        end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   321
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   322
    haveCollision:= ((hwRound(Gear^.Y) and LAND_HEIGHT_MASK) = 0) and ((hwRound(Gear^.X) and LAND_WIDTH_MASK) = 0) and ((Land[hwRound(Gear^.Y), hwRound(Gear^.X)]) <> 0);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   323
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   324
    if not haveCollision then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   325
        begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   326
        // backup gear location
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   327
        tx:= Gear^.X;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   328
        ty:= Gear^.Y;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   329
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   330
        if RopePoints.Count > 0 then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   331
            begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   332
            // set gear location to the remote end of the rope, the attachment point
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   333
            Gear^.X:= RopePoints.ar[0].X;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   334
            Gear^.Y:= RopePoints.ar[0].Y;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   335
            end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   336
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   337
        CheckCollision(Gear);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   338
        // if we haven't found any collision yet then check the other side too
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   339
        if (Gear^.State and gstCollision) = 0 then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   340
            begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   341
            Gear^.dX.isNegative:= not Gear^.dX.isNegative;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   342
            Gear^.dY.isNegative:= not Gear^.dY.isNegative;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   343
            CheckCollision(Gear);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   344
            Gear^.dX.isNegative:= not Gear^.dX.isNegative;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   345
            Gear^.dY.isNegative:= not Gear^.dY.isNegative;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   346
            end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   347
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   348
        haveCollision:= (Gear^.State and gstCollision) <> 0;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   349
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   350
        // restore gear location
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   351
        Gear^.X:= tx;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   352
        Gear^.Y:= ty;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   353
        end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   354
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   355
    // if the attack key is pressed, lose rope contact as well
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   356
    if (Gear^.Message and gmAttack) <> 0 then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   357
        haveCollision:= false;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   358
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   359
    HHGear^.dX.QWordValue:= HHGear^.dX.QWordValue shr 2;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   360
    HHGear^.dY.QWordValue:= HHGear^.dY.QWordValue shr 2;
7674
aead327f1e1a fix for issue 293 : "rope stuck after picking crate"
sheepluva
parents: 7662
diff changeset
   361
    if (not haveCollision) and ((Gear^.State and gsttmpFlag) <> 0) then
7660
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   362
        begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   363
            begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   364
            PlaySound(sndRopeRelease);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   365
            if Gear^.Hedgehog^.CurAmmoType <> amParachute then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   366
                RopeWaitCollision(Gear, HHGear)
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   367
            else
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   368
                RopeDeleteMe(Gear, HHGear)
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   369
            end
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   370
        end
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   371
    else
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   372
        if (Gear^.State and gsttmpFlag) = 0 then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   373
            Gear^.State := Gear^.State or gsttmpFlag;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   374
end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   375
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   376
procedure RopeRemoveFromAmmo(Gear, HHGear: PGear);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   377
begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   378
    if (Gear^.State and gstAttacked) = 0 then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   379
        begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   380
        OnUsedAmmo(HHGear^.Hedgehog^);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   381
        Gear^.State := Gear^.State or gstAttacked
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   382
        end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   383
    ApplyAmmoChanges(HHGear^.Hedgehog^)
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   384
end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   385
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   386
procedure doStepRopeAttach(Gear: PGear);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   387
var 
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   388
    HHGear: PGear;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   389
    tx, ty, tt: hwFloat;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   390
begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   391
    Gear^.X := Gear^.X - Gear^.dX;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   392
    Gear^.Y := Gear^.Y - Gear^.dY;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   393
    Gear^.Elasticity := Gear^.Elasticity + _1;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   394
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   395
    HHGear := Gear^.Hedgehog^.Gear;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   396
    DeleteCI(HHGear);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   397
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   398
    if (HHGear^.State and gstMoving) <> 0 then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   399
        begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   400
        if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   401
            SetLittle(HHGear^.dX);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   402
        if HHGear^.dY.isNegative and (TestCollisionYwithGear(HHGear, -1) <> 0) then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   403
            HHGear^.dY := _0;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   404
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   405
        HHGear^.X := HHGear^.X + HHGear^.dX;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   406
        Gear^.X := Gear^.X + HHGear^.dX;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   407
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   408
        if TestCollisionYwithGear(HHGear, 1) <> 0 then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   409
            begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   410
            CheckHHDamage(HHGear);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   411
            HHGear^.dY := _0
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   412
            //HHGear^.State:= HHGear^.State and (not (gstHHJumping or gstHHHJump));
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   413
            end
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   414
        else
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   415
            begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   416
            HHGear^.Y := HHGear^.Y + HHGear^.dY;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   417
            Gear^.Y := Gear^.Y + HHGear^.dY;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   418
            HHGear^.dY := HHGear^.dY + cGravity;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   419
            if (GameFlags and gfMoreWind) <> 0 then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   420
                HHGear^.dX := HHGear^.dX + cWindSpeed / HHGear^.Density
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   421
            end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   422
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   423
        tt := Gear^.Elasticity;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   424
        tx := _0;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   425
        ty := _0;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   426
        while tt > _20 do
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   427
            begin
8751
4609823efc94 More flagging of Land values. Also use less than for tests of non-terrain, instead of "and $FF00 = 0". Saves a couple of ops, which actually matters a small amount in a few places.
nemo
parents: 8744
diff changeset
   428
            if ((hwRound(Gear^.Y+ty) and LAND_HEIGHT_MASK) = 0) and ((hwRound(Gear^.X+tx) and LAND_WIDTH_MASK) = 0) and (Land[hwRound(Gear^.Y+ty), hwRound(Gear^.X+tx)] > lfAllObjMask) then
7660
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   429
                begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   430
                Gear^.X := Gear^.X + tx;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   431
                Gear^.Y := Gear^.Y + ty;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   432
                Gear^.Elasticity := tt;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   433
                Gear^.doStep := @doStepRopeWork;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   434
                PlaySound(sndRopeAttach);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   435
                with HHGear^ do
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   436
                    begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   437
                    State := State and (not (gstAttacking or gstHHJumping or gstHHHJump));
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   438
                    Message := Message and (not gmAttack)
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   439
                    end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   440
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   441
                RopeRemoveFromAmmo(Gear, HHGear);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   442
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   443
                tt := _0;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   444
                exit
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   445
                end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   446
            tx := tx + Gear^.dX + Gear^.dX;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   447
            ty := ty + Gear^.dY + Gear^.dY;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   448
            tt := tt - _2;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   449
            end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   450
        end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   451
8751
4609823efc94 More flagging of Land values. Also use less than for tests of non-terrain, instead of "and $FF00 = 0". Saves a couple of ops, which actually matters a small amount in a few places.
nemo
parents: 8744
diff changeset
   452
    if Gear^.Elasticity < _20 then Gear^.CollisionMask:= lfLandMask
4609823efc94 More flagging of Land values. Also use less than for tests of non-terrain, instead of "and $FF00 = 0". Saves a couple of ops, which actually matters a small amount in a few places.
nemo
parents: 8744
diff changeset
   453
    else Gear^.CollisionMask:= lfNotCurrentMask;
7660
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   454
    CheckCollision(Gear);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   455
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   456
    if (Gear^.State and gstCollision) <> 0 then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   457
        if Gear^.Elasticity < _10 then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   458
            Gear^.Elasticity := _10000
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   459
    else
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   460
        begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   461
        Gear^.doStep := @doStepRopeWork;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   462
        PlaySound(sndRopeAttach);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   463
        with HHGear^ do
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   464
            begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   465
            State := State and (not (gstAttacking or gstHHJumping or gstHHHJump));
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   466
            Message := Message and (not gmAttack)
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   467
            end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   468
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   469
        RopeRemoveFromAmmo(Gear, HHGear);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   470
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   471
        exit
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   472
        end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   473
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   474
    if (Gear^.Elasticity > Gear^.Friction)
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   475
        or ((Gear^.Message and gmAttack) = 0)
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   476
        or ((HHGear^.State and gstHHDriven) = 0)
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   477
        or (HHGear^.Damage > 0) then
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   478
            begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   479
            with Gear^.Hedgehog^.Gear^ do
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   480
                begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   481
                State := State and (not gstAttacking);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   482
                Message := Message and (not gmAttack)
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   483
                end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   484
        DeleteGear(Gear);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   485
        exit;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   486
        end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   487
    if CheckGearDrowning(HHGear) then DeleteGear(Gear)
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   488
end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   489
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   490
procedure doStepRope(Gear: PGear);
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   491
begin
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   492
    Gear^.dX := - Gear^.dX;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   493
    Gear^.dY := - Gear^.dY;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   494
    Gear^.doStep := @doStepRopeAttach;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   495
    PlaySound(sndRopeShot)
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   496
end;
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   497
8398faa1e628 Fix line endings, add missing amMine entry
nemo
parents: 7658
diff changeset
   498
end.