hedgewars/uGears.pas
changeset 145 e593d5266e01
parent 126 93df479aa1b9
child 149 aae256899c49
equal deleted inserted replaced
144:e6084b0c9316 145:e593d5266e01
    77     GearsList: PGear = nil;
    77     GearsList: PGear = nil;
    78     GearsListMutex: PSDL_mutex;
    78     GearsListMutex: PSDL_mutex;
    79 
    79 
    80 implementation
    80 implementation
    81 uses uWorld, uMisc, uStore, uConsole, uSound, uTeams, uRandom, uCollisions,
    81 uses uWorld, uMisc, uStore, uConsole, uSound, uTeams, uRandom, uCollisions,
    82      uLand, uIO, uLandGraphics, uAIMisc, uLocale;
    82      uLand, uIO, uLandGraphics, uAIMisc, uLocale, uAI;
    83 var RopePoints: record
    83 var RopePoints: record
    84                 Count: Longword;
    84                 Count: Longword;
    85                 HookAngle: integer;
    85                 HookAngle: integer;
    86                 ar: array[0..300] of record
    86                 ar: array[0..300] of record
    87                                   X, Y: Double;
    87                                   X, Y: Double;
   205                 Result.Friction:= 0.995;
   205                 Result.Friction:= 0.995;
   206                 Result.Timer:= 3000;
   206                 Result.Timer:= 3000;
   207                 end;
   207                 end;
   208         gtCase: begin
   208         gtCase: begin
   209                 Result.Radius:= 16;
   209                 Result.Radius:= 16;
   210                 Result.Elasticity:= 0.6
   210                 Result.Elasticity:= 0.4
   211                 end;
   211                 end;
   212   gtDEagleShot: begin
   212   gtDEagleShot: begin
   213                 Result.Radius:= 1;
   213                 Result.Radius:= 1;
   214                 Result.Radius:= 1;
   214                 Result.Radius:= 1;
   215                 Result.Health:= 50
   215                 Result.Health:= 50
   261       exit
   261       exit
   262       end else
   262       end else
   263       begin
   263       begin
   264       team:= PHedgehog(Gear.Hedgehog).Team;
   264       team:= PHedgehog(Gear.Hedgehog).Team;
   265       PHedgehog(Gear.Hedgehog).Gear:= nil;
   265       PHedgehog(Gear.Hedgehog).Gear:= nil;
       
   266       if CurrentTeam.Hedgehogs[CurrentTeam.CurrHedgehog].Gear = Gear then
       
   267          FreeActionsList; // to avoid ThinkThread on drawned gear
   266       RecountTeamHealth(team);
   268       RecountTeamHealth(team);
   267       end;
   269       end;
   268 {$IFDEF DEBUGFILE}AddFileLog('DeleteGear: handle = '+inttostr(integer(Gear)));{$ENDIF}
   270 {$IFDEF DEBUGFILE}AddFileLog('DeleteGear: handle = '+inttostr(integer(Gear)));{$ENDIF}
   269 SDL_LockMutex(GearsListMutex);
   271 SDL_LockMutex(GearsListMutex);
   270 if CurAmmoGear = Gear then CurAmmoGear:= nil;
   272 if CurAmmoGear = Gear then CurAmmoGear:= nil;