hedgewars/uTeams.pas
branchhedgeroid
changeset 5385 a864a0aeed96
parent 5357 ec36f3d53f3c
child 5638 e35ba2a400d8
equal deleted inserted replaced
5383:cb217271f344 5385:a864a0aeed96
   177 
   177 
   178 CurrentHedgehog:= @(CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]);
   178 CurrentHedgehog:= @(CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]);
   179 end;
   179 end;
   180 
   180 
   181 procedure AfterSwitchHedgehog;
   181 procedure AfterSwitchHedgehog;
   182 var g: PGear;
   182 var i, t: LongInt;
   183     i, t: LongInt;
       
   184     CurWeapon: PAmmo;
   183     CurWeapon: PAmmo;
   185 
   184 
   186 begin
   185 begin
   187 if PlacingHogs then
   186 if PlacingHogs then
   188    begin
   187    begin
   227     // cWindSpeedf:= cWindSpeed.QWordValue / _1.QWordValue throws 'Internal error 200502052' on Darwin
   226     // cWindSpeedf:= cWindSpeed.QWordValue / _1.QWordValue throws 'Internal error 200502052' on Darwin
   228     // see http://mantis.freepascal.org/view.php?id=17714
   227     // see http://mantis.freepascal.org/view.php?id=17714
   229     cWindSpeedf:= SignAs(cWindSpeed,cWindSpeed).QWordValue / SignAs(_1,_1).QWordValue;
   228     cWindSpeedf:= SignAs(cWindSpeed,cWindSpeed).QWordValue / SignAs(_1,_1).QWordValue;
   230     if cWindSpeed.isNegative then
   229     if cWindSpeed.isNegative then
   231         CWindSpeedf := -cWindSpeedf;
   230         CWindSpeedf := -cWindSpeedf;
   232     g:= AddGear(0, 0, gtATSmoothWindCh, 0, _0, _0, 1);
   231     AddVisualGear(0, 0, vgtSmoothWindBar);
   233     g^.Tag:= hwRound(cWindSpeed * 72 / cMaxWindSpeed);
       
   234     AddFileLog('Wind = '+FloatToStr(cWindSpeed));
   232     AddFileLog('Wind = '+FloatToStr(cWindSpeed));
   235     end;
   233     end;
   236 
   234 
   237 ApplyAmmoChanges(CurrentHedgehog^);
   235 ApplyAmmoChanges(CurrentHedgehog^);
   238 
   236