Script: Fix crashes

This commit is contained in:
David Markowitz 2023-10-22 17:57:41 -07:00
parent 23d71340c9
commit d45e7bbda9

View File

@ -196,7 +196,7 @@ void BossSpiderQueenEnemyServer::SpiderWaveManager(Entity* self) {
for (auto en : hatchList) { for (auto en : hatchList) {
if (en == randomEgg) { if (en == randomEgg) {
randomEggLoc++; randomEggLoc++;
randomEgg = spiderEggs[randomEggLoc]; randomEgg = spiderEggs.at(randomEggLoc % spiderEggs.size());
} }
} }
@ -288,7 +288,7 @@ void BossSpiderQueenEnemyServer::RunRainOfFire(Entity* self) {
if (index == 0) { if (index == 0) {
impactList.insert(impactList.end(), spawned.begin(), spawned.end()); impactList.insert(impactList.end(), spawned.begin(), spawned.end());
} else { } else if (!spawned.empty()) {
const auto randomIndex = GeneralUtils::GenerateRandomNumber<int32_t>(0, spawned.size() - 1); const auto randomIndex = GeneralUtils::GenerateRandomNumber<int32_t>(0, spawned.size() - 1);
impactList.push_back(spawned[randomIndex]); impactList.push_back(spawned[randomIndex]);