merge
authorunc0rr
Mon, 21 Mar 2011 21:23:39 +0300
changeset 5036 cb5fa93c7ae0
parent 5032 813554ab76b8 (current diff)
parent 5035 a00636066077 (diff)
child 5037 1edc06d2247c
merge
--- 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
--- 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;
--- 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
--- 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