Advertisement
Pr0nogo

Untitled

Jul 4th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. int __fastcall getStandardAttackTargetProc(CUNIT *target, CUNIT *unit)
  2. {
  3. CUNIT *v2; // edi
  4. CUNIT *v3; // esi
  5. int v4; // eax
  6. CUNIT *v5; // ebx
  7. int v6; // eax
  8. int v7; // eax
  9. int v8; // eax
  10. CUNIT *v9; // esi
  11. int v10; // eax
  12. int v11; // eax
  13. CUNIT *a1; // [esp+4h] [ebp-4h]
  14.  
  15. v2 = target;
  16. a1 = unit;
  17. if ( target != unit )
  18. {
  19. if ( (unsigned __int8)(1 << unit->owner) & target->sprite->visibility )
  20. {
  21. v3 = unit;
  22. LOBYTE(v4) = unitCanAttackTarget(target, unit, 1);
  23. if ( v4 )
  24. {
  25. v5 = v3;
  26. LOBYTE(v6) = isUnitEnemy((int)v3, (int)v2);
  27. if ( v6 )
  28. {
  29. if ( !dword_6955B8[9] || (LOBYTE(v7) = isTargetWithinMinRange(v3, dword_6955B8[9], v2), !v7) )
  30. {
  31. LOBYTE(v8) = isTargetWithinMinRange(v3, dword_6957A4, v2);
  32. if ( v8 )
  33. {
  34. v9 = v3->subUnit;
  35. LOBYTE(v10) = unitIsSubunit(v5->subUnit);
  36. if ( !v10 )
  37. v9 = v5;
  38. if ( !(v9->statusFlags & 0x10000) )
  39. {
  40. if ( !isAngleInAttackAngle(
  41. v2->sprite->position.y,
  42. v2->sprite->position.x,
  43. v9,
  44. unitsdat_GroundWeapon[(unsigned __int16)v9->type]) )
  45. return 0;
  46. v5 = a1;
  47. }
  48. if ( !sub_4A1140(v5, v2) )
  49. {
  50. v11 = sub_442160(a1, v2);
  51. sub_440160(v11, v2);
  52. }
  53. }
  54. }
  55. }
  56. }
  57. }
  58. }
  59. return 0;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement