Tidier way to handle crosshair drawing. show/hide based on CurAmmoGear for alt attack weps
--- 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: