hedgewars/uCommandHandlers.pas
changeset 10672 c2004c3e9c7d
parent 10633 2f062fac5791
child 10818 f642a28cab0c
equal deleted inserted replaced
10671:17dd6265a08a 10672:c2004c3e9c7d
   321     Message:= Message or (gmHJump and InputMask);
   321     Message:= Message or (gmHJump and InputMask);
   322     ScriptCall('onHJump');
   322     ScriptCall('onHJump');
   323 end;
   323 end;
   324 
   324 
   325 procedure chAttack_p(var s: shortstring);
   325 procedure chAttack_p(var s: shortstring);
       
   326 var inbtwnTrgtAttks: Boolean;
   326 begin
   327 begin
   327 s:= s; // avoid compiler hint
   328 s:= s; // avoid compiler hint
   328 if CheckNoTeamOrHH then
   329 if CheckNoTeamOrHH then
   329     exit;
   330     exit;
   330 bShowFinger:= false;
   331 bShowFinger:= false;
   331 with CurrentHedgehog^.Gear^ do
   332 with CurrentHedgehog^.Gear^ do
   332     begin
   333     begin
   333     AddFileLog('/+attack: hedgehog''s Gear^.State = '+inttostr(State));
   334     AddFileLog('/+attack: hedgehog''s Gear^.State = '+inttostr(State));
   334     if ((State and gstHHDriven) <> 0) then
   335     if ((State and gstHHDriven) <> 0) then
   335         begin
   336         begin
   336         FollowGear:= CurrentHedgehog^.Gear;
   337         inbtwnTrgtAttks:= ((GameFlags and gfInfAttack) <> 0) and ((Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget) <> 0);
       
   338         if (not inbtwnTrgtAttks) then
       
   339             FollowGear:= CurrentHedgehog^.Gear;
   337         if not isExternalSource then
   340         if not isExternalSource then
   338             SendIPC(_S'A');
   341             SendIPC(_S'A');
   339         Message:= Message or (gmAttack and InputMask);
   342         Message:= Message or (gmAttack and InputMask);
   340         ScriptCall('onAttack'); // so if I fire airstrike, it doesn't count as attack? fine, fine
   343         ScriptCall('onAttack'); // so if I fire airstrike, it doesn't count as attack? fine, fine
   341         end
   344         end