Tomash667 / carpg

Combination of action rpg with roguelike.
https://carpg.pl
MIT License
16 stars 15 forks source link

Crash at arena combat #338

Closed Tomash667 closed 5 years ago

Tomash667 commented 5 years ago

Version: 0.8

Crash guid: 255d78bc-1bf1-4ea5-8b2e-801b65d49b81

Player selected difficulty level medium at arena, failed to spawn some unit. Team size was 5 or more units (there was summoned wolf) and maybe there was no free space for them.

Test all arena groups and verify unit variable.

// spawn enemies
    InsideBuilding* arena = L.GetArena();
    for(TmpUnitGroup::Spawn& spawn : part->Roll(lvl, units.size()))
    {
        Unit* u = L.SpawnUnitInsideArea(arena->ctx, arena->arena2, *spawn.first, spawn.second);
        u->rot = 0.f; <<<<<<<<<<<<<<<<
        u->in_arena = 1;
        u->frozen = FROZEN::YES;
        units.push_back(u);
    }