hedgewars/uGearsHandlersRope.pas
changeset 11271 31e0e38e703c
parent 11262 6d5505bff3f3
child 11537 bf86c6cb9341
equal deleted inserted replaced
11270:35e359585dea 11271:31e0e38e703c
    41         begin
    41         begin
    42         OutError('ERROR: doStepRopeAfterAttack called while HHGear = nil', IsNilHHFatal);
    42         OutError('ERROR: doStepRopeAfterAttack called while HHGear = nil', IsNilHHFatal);
    43         DeleteGear(Gear);
    43         DeleteGear(Gear);
    44         exit()
    44         exit()
    45         end
    45         end
    46     else if not CurrentTeam^.ExtDriven then FollowGear := HHGear;
    46     else if not CurrentTeam^.ExtDriven and (FollowGear <> nil) then FollowGear := HHGear;
    47 
    47 
    48     tX:= HHGear^.X;
    48     tX:= HHGear^.X;
    49     if WorldWrap(HHGear) and (WorldEdge = weWrap) and
    49     if WorldWrap(HHGear) and (WorldEdge = weWrap) and
    50        ((TestCollisionXwithGear(HHGear, 1) <> 0) or (TestCollisionXwithGear(HHGear, -1) <> 0))  then
    50        ((TestCollisionXwithGear(HHGear, 1) <> 0) or (TestCollisionXwithGear(HHGear, -1) <> 0))  then
    51         begin
    51         begin
   137         begin
   137         begin
   138         OutError('ERROR: doStepRopeWork called while HHGear = nil', IsNilHHFatal);
   138         OutError('ERROR: doStepRopeWork called while HHGear = nil', IsNilHHFatal);
   139         DeleteGear(Gear);
   139         DeleteGear(Gear);
   140         exit()
   140         exit()
   141         end
   141         end
   142     else if not CurrentTeam^.ExtDriven then FollowGear := HHGear;
   142     else if not CurrentTeam^.ExtDriven and (FollowGear <> nil) then FollowGear := HHGear;
   143 
   143 
   144     if ((HHGear^.State and gstHHDriven) = 0) or
   144     if ((HHGear^.State and gstHHDriven) = 0) or
   145         (CheckGearDrowning(HHGear)) or (Gear^.PortalCounter <> 0) then
   145         (CheckGearDrowning(HHGear)) or (Gear^.PortalCounter <> 0) then
   146         begin
   146         begin
   147         PlaySound(sndRopeRelease);
   147         PlaySound(sndRopeRelease);
   437         begin
   437         begin
   438         OutError('ERROR: doStepRopeAttach called while HHGear = nil', IsNilHHFatal);
   438         OutError('ERROR: doStepRopeAttach called while HHGear = nil', IsNilHHFatal);
   439         DeleteGear(Gear);
   439         DeleteGear(Gear);
   440         exit()
   440         exit()
   441         end
   441         end
   442     else if not CurrentTeam^.ExtDriven then FollowGear := HHGear;
   442     else if not CurrentTeam^.ExtDriven and (FollowGear <> nil) then FollowGear := HHGear;
   443 
   443 
   444     DeleteCI(HHGear);
   444     DeleteCI(HHGear);
   445 
   445 
   446     if (HHGear^.State and gstMoving) <> 0 then
   446     if (HHGear^.State and gstMoving) <> 0 then
   447         begin
   447         begin