Script: Fix crashes (#1233)

This commit is contained in:
David Markowitz 2023-10-23 07:56:12 -07:00 committed by GitHub
parent 5ea06f9bda
commit 9aa81f95cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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]);