Several crash fixes

This commit is contained in:
郑佩茹
2022-03-23 10:53:04 -06:00
parent f1bcca1a7b
commit 180014eb88
2 changed files with 5 additions and 1 deletions

View File

@@ -3955,6 +3955,10 @@ std::vector<WorldPosition> TravelMgr::getNextPoint(WorldPosition center, std::ve
rnd -= weights[i];
}
// Peiru: Crash failsafe - if the retVec is still empty but points exist, return first point
if (retVec.empty() && points.size() > 0)
retVec.push_back(points[0]);
if (!retVec.empty())
return retVec;