Advertisement
Pr0nogo

Untitled

Dec 21st, 2020
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. if(builtUnit != NULL) {
  2. u32 hpGain = getHPGainForRepair(builtUnit);
  3. bool extraBuild = false;
  4. if (scbw::get_generic_value(builtUnit, ValueId::CrucibleValue) == 0) {
  5. auto r = 256;
  6. auto n = unitRangeCount(NULL, CFlags::NoInvincible | CFlags::Ally, { UnitId::ProtossCrucible });
  7. scbw::UnitFinder unitsInSplash(builtUnit->position.x - r, builtUnit->position.y - r,
  8. builtUnit->position.x + r, builtUnit->position.y + r);
  9. for (int i = 0; i < unitsInSplash.getUnitCount(); i++) {
  10. auto unit = unitsInSplash.getUnit(i);
  11. if (n.match(unit)) {
  12. scbw::set_generic_value(builtUnit, ValueId::CrucibleValue, 5);//6 is ~100/15
  13. buildingAddon(builtUnit, hpGain, TRUE);
  14. if (builtUnit->status & UnitStatus::Completed) {
  15. extraBuild = true;
  16. }
  17. break;
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement