Tidier way to handle crosshair drawing. show/hide based on CurAmmoGear for alt attack weps
authornemo
Sat, 27 Mar 2010 17:03:27 +0000
changeset 3114 3a3d1ee2ebd0
parent 3113 2829ea0dd47c
child 3115 831bd0f7050d
Tidier way to handle crosshair drawing. show/hide based on CurAmmoGear for alt attack weps
hedgewars/uAmmos.pas
hedgewars/uGears.pas
--- a/hedgewars/uAmmos.pas	Sat Mar 27 16:57:18 2010 +0000
+++ b/hedgewars/uAmmos.pas	Sat Mar 27 17:03:27 2010 +0000
@@ -314,7 +314,10 @@
             Gear^.State:= Gear^.State and not gstHHChooseTarget;
             isCursorVisible:= false
             end;
-        ShowCrosshair:= (Propz and ammoprop_NoCrosshair) = 0
+        if (CurAmmoGear <> nil) and ((CurAmmoGear^.Ammo^.Propz and ammoprop_AltAttack) <> 0) then
+            ShowCrosshair:= (CurAmmoGear^.Ammo^.Propz and ammoprop_NoCrossHair) = 0
+        else
+            ShowCrosshair:= (Propz and ammoprop_NoCrosshair) = 0;
         end
     end
 end;
--- a/hedgewars/uGears.pas	Sat Mar 27 16:57:18 2010 +0000
+++ b/hedgewars/uGears.pas	Sat Mar 27 17:03:27 2010 +0000
@@ -957,7 +957,7 @@
 if (Gear^.State and gstHHDriven) <> 0 then
     begin
     if ((Gear^.State and gstHHThinking) = 0) and
-       (ShowCrosshair or ((CurAmmoGear <> nil) and (CurAmmoGear^.Kind = gtRope))) and
+       ShowCrosshair and 
        ((Gear^.State and (gstAttacked or gstAnimation)) = 0) then
         begin
 (* These calculations are a little complex for a few reasons: