Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. if ((PreviousDistance != 0) && (CurrentDistance < max(100, NumberOfWeapons * PlacementDistance)))
  2. {
  3. if (CurrentDistance < PreviousDistance)
  4. {
  5. // Inbound leg.
  6. // DistanceTargets range from 0 to NumberOfWeapons / 2.
  7.  
  8. for (int I = 0; I <= int(NumberOfWeapons) / 2; I++)
  9. {
  10. /*if (abs(CurrentDistance - DistanceTargets[I]) < 5)
  11. {
  12. // Within 5 meters of a target.
  13. // Fire weapon.
  14.  
  15. WeaponSystemInterface->FireWeapon(WeaponID, OBJHANDLE(0));
  16. DistanceTargets[I] = -10;
  17. WeaponsFired++;
  18.  
  19. break;
  20. }*/
  21. }
  22. }
  23.  
  24. else if (CurrentDistance > PreviousDistance)
  25. {
  26. // Outbound leg.
  27. // DistanceTargets range from NumberOfWeapons / 2 + 1 to NumberOfWeapons - 1.
  28.  
  29. for (int I = max(0, (int(NumberOfWeapons) / 2) - 1); I < DistanceTargets.size(); I++)
  30. {
  31. if (abs(CurrentDistance - DistanceTargets[I]) < 5)
  32. {
  33. // Within 5 meters of a target.
  34. // Fire weapon.
  35.  
  36. WeaponSystemInterface->FireWeapon(WeaponID, OBJHANDLE(0));
  37. DistanceTargets[I] = -10;
  38. WeaponsFired++;
  39.  
  40. break;
  41. }
  42. }
  43.  
  44. if (CurrentDistance > (NumberOfWeapons * PlacementDistance))
  45. {
  46. if (WeaponsFired > 0)
  47. {
  48. Master->Notification(1);
  49. }
  50.  
  51. else
  52. {
  53. Master->Notification(0);
  54. }
  55.  
  56. Finished = true;
  57. }
  58. }
  59.  
  60. if (WeaponsFired >= NumberOfWeapons)
  61. {
  62. Finished = true;
  63. Master->Notification(1);
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement