Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int __fastcall getStandardAttackTargetProc(CUNIT *target, CUNIT *unit)
- {
- CUNIT *v2; // edi
- CUNIT *v3; // esi
- int v4; // eax
- CUNIT *v5; // ebx
- int v6; // eax
- int v7; // eax
- int v8; // eax
- CUNIT *v9; // esi
- int v10; // eax
- int v11; // eax
- CUNIT *a1; // [esp+4h] [ebp-4h]
- v2 = target;
- a1 = unit;
- if ( target != unit )
- {
- if ( (unsigned __int8)(1 << unit->owner) & target->sprite->visibility )
- {
- v3 = unit;
- LOBYTE(v4) = unitCanAttackTarget(target, unit, 1);
- if ( v4 )
- {
- v5 = v3;
- LOBYTE(v6) = isUnitEnemy((int)v3, (int)v2);
- if ( v6 )
- {
- if ( !dword_6955B8[9] || (LOBYTE(v7) = isTargetWithinMinRange(v3, dword_6955B8[9], v2), !v7) )
- {
- LOBYTE(v8) = isTargetWithinMinRange(v3, dword_6957A4, v2);
- if ( v8 )
- {
- v9 = v3->subUnit;
- LOBYTE(v10) = unitIsSubunit(v5->subUnit);
- if ( !v10 )
- v9 = v5;
- if ( !(v9->statusFlags & 0x10000) )
- {
- if ( !isAngleInAttackAngle(
- v2->sprite->position.y,
- v2->sprite->position.x,
- v9,
- unitsdat_GroundWeapon[(unsigned __int16)v9->type]) )
- return 0;
- v5 = a1;
- }
- if ( !sub_4A1140(v5, v2) )
- {
- v11 = sub_442160(a1, v2);
- sub_440160(v11, v2);
- }
- }
- }
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement