# HG changeset patch # User unc0rr # Date 1300731819 -10800 # Node ID cb5fa93c7ae02273f44df27e59aeae36840952bf # Parent 813554ab76b86325508dfcc9cb16d2f37c7a3218# Parent a00636066077e927fc24de80ed9658556d0ee45f merge diff -r 813554ab76b8 -r cb5fa93c7ae0 hedgewars/HHHandlers.inc --- a/hedgewars/HHHandlers.inc Sun Mar 20 15:03:39 2011 +0100 +++ b/hedgewars/HHHandlers.inc Mon Mar 21 21:23:39 2011 +0300 @@ -90,7 +90,14 @@ if i <= cMaxSlotAmmoIndex then ammoidx:= i else ammoidx:= -1 end; - if ammoidx >= 0 then CurAmmoType:= Ammo^[slot, ammoidx].AmmoType; + if ammoidx >= 0 then + begin + CurAmmoType:= Ammo^[slot, ammoidx].AmmoType; + if (CurAmmoGear <> nil) and ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0) then + ShowCrosshair:= (Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_NoCrossHair) = 0 + else + ShowCrosshair:= (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoCrosshair) = 0; + end end end; @@ -382,9 +389,13 @@ if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) = 0) and ((GameFlags and gfInfAttack) = 0) then begin if TagTurnTimeLeft = 0 then TagTurnTimeLeft:= TurnTimeLeft; - TurnTimeLeft:=round(Ammoz[a].TimeAfterTurn * (cGetAwayTime / 100)); + TurnTimeLeft:=(Ammoz[a].TimeAfterTurn * cGetAwayTime) div 100; end; if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) = 0) then State:= State or gstAttacked; + if (CurAmmoGear <> nil) and ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0) then + ShowCrosshair:= (Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_NoCrossHair) = 0 + else + ShowCrosshair:= (Ammoz[a].Ammo.Propz and ammoprop_NoCrosshair) = 0; if (Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) <> 0 then ApplyAmmoChanges(CurrentHedgehog^) end; end diff -r 813554ab76b8 -r cb5fa93c7ae0 hedgewars/uAmmos.pas --- a/hedgewars/uAmmos.pas Sun Mar 20 15:03:39 2011 +0100 +++ b/hedgewars/uAmmos.pas Mon Mar 21 21:23:39 2011 +0300 @@ -295,6 +295,10 @@ end; TryDo(slot <= cMaxSlotIndex, 'Ammo slot index overflow', true); CurAmmoType:= Ammo^[slot, ammoidx].AmmoType; + if (CurAmmoGear <> nil) and ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0) then + ShowCrosshair:= (Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_NoCrossHair) = 0 + else + ShowCrosshair:= (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoCrosshair) = 0; end end; @@ -333,10 +337,6 @@ Gear^.State:= Gear^.State and not gstHHChooseTarget; isCursorVisible:= false end; - if (CurAmmoGear <> nil) and ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0) then - ShowCrosshair:= (Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_NoCrossHair) = 0 - else - ShowCrosshair:= (Propz and ammoprop_NoCrosshair) = 0; end end; end; diff -r 813554ab76b8 -r cb5fa93c7ae0 hedgewars/uGears.pas --- a/hedgewars/uGears.pas Sun Mar 20 15:03:39 2011 +0100 +++ b/hedgewars/uGears.pas Mon Mar 21 21:23:39 2011 +0300 @@ -583,7 +583,10 @@ team:= Gear^.Hedgehog^.Team; if CurrentHedgehog^.Gear = Gear then + begin FreeActionsList; // to avoid ThinkThread on drawned gear + if ((Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) <> 0) and (CurrentHedgehog^.MultiShootAttacks > 0) then OnUsedAmmo(CurrentHedgehog^); + end; Gear^.Hedgehog^.Gear:= nil; if Gear^.Hedgehog^.King then diff -r 813554ab76b8 -r cb5fa93c7ae0 hedgewars/uGearsRender.pas --- a/hedgewars/uGearsRender.pas Sun Mar 20 15:03:39 2011 +0100 +++ b/hedgewars/uGearsRender.pas Mon Mar 21 21:23:39 2011 +0300 @@ -259,8 +259,8 @@ if (Gear^.State and gstHHDriven) <> 0 then begin if ((Gear^.State and gstHHThinking) = 0) and - (ShowCrosshair or ((CurAmmoGear <> nil) and (CurAmmoGear^.Kind = gtRope))) and - ((Gear^.State and (gstAttacked or gstAnimation)) = 0) then + ShowCrosshair and + ((Gear^.State and gstAnimation) = 0) then begin (* These calculations are a little complex for a few reasons: 1: I need to draw the laser from weapon origin to nearest land