Advertisement
Guest User

Untitled

a guest
Jan 17th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. int corpses = 6;
  2. std::vector<CSprite*> stuff;
  3. for (LoneSprite *ls = *first_lone_sprite; ls; ls = ls->link.next) {
  4. if (ls->sprite != NULL) {
  5. int res_id = 228;
  6. switch (ls->sprite->spriteId) {
  7. case 192:
  8. res_id = UnitId::dragoon;
  9. break;
  10. case 369:
  11. res_id = UnitId::high_templar;
  12. break;
  13. case 507:
  14. res_id = UnitId::zealot;
  15. break;
  16. default:
  17. break;
  18. };
  19. auto distance = scbw::getDistanceFast(currentClientSelectionUnit->position.x,currentClientSelectionUnit->position.y,
  20. ls->sprite->position.x,ls->sprite->position.y);
  21. if (res_id != 228 && corpses>0 && distance<=256 && ls->sprite->playerId==*ACTIVE_PLAYER_ID) {
  22. auto pos = ls->sprite->position;
  23. fixTargetLocation(&pos, res_id);
  24. CUnit* resurrected = CreateUnit(res_id, pos.x, pos.y, 0);
  25. if (resurrected == NULL) {
  26. //scbw::printText("do not spawn");
  27. }
  28. else { //F4A26
  29. //scbw::printText("spawn");
  30. function_004A01F0(resurrected);
  31. updateUnitStrength(resurrected);
  32. stuff.push_back(ls->sprite);
  33. corpses--;
  34. }
  35. }
  36.  
  37. }
  38. }
  39. for (int i = 0; i < stuff.size(); i++) {
  40. stuff[i]->free();
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement