hedgewars/uAmmos.pas
changeset 7341 d70478d265ec
parent 7337 c224cd2d32f3
child 7426 55b49cc1f33a
equal deleted inserted replaced
7339:5984b749ad9b 7341:d70478d265ec
   301     end;
   301     end;
   302 end;
   302 end;
   303 
   303 
   304 procedure ApplyAngleBounds(var Hedgehog: THedgehog; AmmoType: TAmmoType);
   304 procedure ApplyAngleBounds(var Hedgehog: THedgehog; AmmoType: TAmmoType);
   305 begin
   305 begin
   306 with Hedgehog do
   306 if Hedgehog.Gear <> nil then
   307     begin
   307     with Hedgehog do
   308     CurMinAngle:= Ammoz[AmmoType].minAngle;
   308         begin
   309     if Ammoz[AmmoType].maxAngle <> 0 then
   309         CurMinAngle:= Ammoz[AmmoType].minAngle;
   310         CurMaxAngle:= Ammoz[AmmoType].maxAngle
   310         if Ammoz[AmmoType].maxAngle <> 0 then
   311     else
   311             CurMaxAngle:= Ammoz[AmmoType].maxAngle
   312         CurMaxAngle:= cMaxAngle;
   312         else
   313 
   313             CurMaxAngle:= cMaxAngle;
   314     with Hedgehog.Gear^ do
   314 
   315         begin
   315         with Hedgehog.Gear^ do
   316         if Angle < CurMinAngle then
   316             begin
   317             Angle:= CurMinAngle;
   317             if Angle < CurMinAngle then
   318         if Angle > CurMaxAngle then
   318                 Angle:= CurMinAngle;
   319             Angle:= CurMaxAngle;
   319             if Angle > CurMaxAngle then
       
   320                 Angle:= CurMaxAngle;
       
   321             end
   320         end
   322         end
   321     end
       
   322 end;
   323 end;
   323 
   324 
   324 procedure SwitchToFirstLegalAmmo(var Hedgehog: THedgehog);
   325 procedure SwitchToFirstLegalAmmo(var Hedgehog: THedgehog);
   325 var slot, ammoidx: LongWord;
   326 var slot, ammoidx: LongWord;
   326 begin
   327 begin
   378         if (Propz and ammoprop_Timerable) <> 0 then
   379         if (Propz and ammoprop_Timerable) <> 0 then
   379             s:= s + ', ' + IntToStr(Timer div 1000) + ' ' + trammo[sidSeconds];
   380             s:= s + ', ' + IntToStr(Timer div 1000) + ' ' + trammo[sidSeconds];
   380         AddCaption(s, Team^.Clan^.Color, capgrpAmmoinfo);
   381         AddCaption(s, Team^.Clan^.Color, capgrpAmmoinfo);
   381         if (Propz and ammoprop_NeedTarget) <> 0 then
   382         if (Propz and ammoprop_NeedTarget) <> 0 then
   382             begin
   383             begin
   383             Gear^.State:= Gear^.State or      gstHHChooseTarget;
   384             if Gear <> nil then Gear^.State:= Gear^.State or      gstHHChooseTarget;
   384             isCursorVisible:= true
   385             isCursorVisible:= true
   385             end
   386             end
   386         else
   387         else
   387             begin
   388             begin
   388             Gear^.State:= Gear^.State and not gstHHChooseTarget;
   389             if Gear <> nil then Gear^.State:= Gear^.State and not gstHHChooseTarget;
   389             isCursorVisible:= false
   390             isCursorVisible:= false
   390             end;
   391             end;
   391         end
   392         end
   392     end;
   393     end;
   393 end;
   394 end;