hedgewars/uGears.pas
changeset 3470 2b0c88693535
parent 3461 0781275649e9
child 3471 e1f1ab5dfd8f
equal deleted inserted replaced
3469:39e16d76d745 3470:2b0c88693535
   821 
   821 
   822 //Purpose, to reset all transient attributes toggled by a utility and clean up various gears and effects at end of turn
   822 //Purpose, to reset all transient attributes toggled by a utility and clean up various gears and effects at end of turn
   823 //If any of these are set as permanent toggles in the frontend, that needs to be checked and skipped here.
   823 //If any of these are set as permanent toggles in the frontend, that needs to be checked and skipped here.
   824 procedure EndTurnCleanup;
   824 procedure EndTurnCleanup;
   825 var  i: LongInt;
   825 var  i: LongInt;
   826     tmpGear, iterator: PGear;
   826     iterator: PGear;
   827 begin
   827 begin
   828     SpeechText:= ''; // in case it has not been consumed
   828     SpeechText:= ''; // in case it has not been consumed
   829 
   829 
   830     if (GameFlags and gfLowGravity) = 0 then
   830     if (GameFlags and gfLowGravity) = 0 then
   831         cGravity:= cMaxWindSpeed * 2;
   831         cGravity:= cMaxWindSpeed * 2;
   856                   if (Gear <> nil) then
   856                   if (Gear <> nil) then
   857                      if (GameFlags and gfInvulnerable) = 0 then
   857                      if (GameFlags and gfInvulnerable) = 0 then
   858                         Gear^.Invulnerable:= false;
   858                         Gear^.Invulnerable:= false;
   859                   end;
   859                   end;
   860     iterator:= GearsList;
   860     iterator:= GearsList;
   861     tmpGear:= nil;
       
   862     while iterator <> nil do
   861     while iterator <> nil do
   863         begin
   862         begin
   864         if (iterator^.Kind = gtPortal) then 
   863         if (iterator^.Kind = gtPortal) then iterator^.Timer:= 0;
   865             begin
   864         iterator:= iterator^.NextGear;
   866             tmpGear:= iterator;
       
   867             iterator:= iterator^.NextGear;
       
   868             DeleteGear(tmpGear)
       
   869             end
       
   870         else iterator:= iterator^.NextGear;
       
   871         end;
   865         end;
   872 end;
   866 end;
   873 
   867 
   874 procedure ApplyDamage(Gear: PGear; Damage: Longword);
   868 procedure ApplyDamage(Gear: PGear; Damage: Longword);
   875 var s: shortstring;
   869 var s: shortstring;