Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int corpses = 6;
- std::vector<CSprite*> stuff;
- for (LoneSprite *ls = *first_lone_sprite; ls; ls = ls->link.next) {
- if (ls->sprite != NULL) {
- int res_id = 228;
- switch (ls->sprite->spriteId) {
- case 192:
- res_id = UnitId::dragoon;
- break;
- case 369:
- res_id = UnitId::high_templar;
- break;
- case 507:
- res_id = UnitId::zealot;
- break;
- default:
- break;
- };
- auto distance = scbw::getDistanceFast(currentClientSelectionUnit->position.x,currentClientSelectionUnit->position.y,
- ls->sprite->position.x,ls->sprite->position.y);
- if (res_id != 228 && corpses>0 && distance<=256 && ls->sprite->playerId==*ACTIVE_PLAYER_ID) {
- auto pos = ls->sprite->position;
- fixTargetLocation(&pos, res_id);
- CUnit* resurrected = CreateUnit(res_id, pos.x, pos.y, 0);
- if (resurrected == NULL) {
- //scbw::printText("do not spawn");
- }
- else { //F4A26
- //scbw::printText("spawn");
- function_004A01F0(resurrected);
- updateUnitStrength(resurrected);
- stuff.push_back(ls->sprite);
- corpses--;
- }
- }
- }
- }
- for (int i = 0; i < stuff.size(); i++) {
- stuff[i]->free();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement