don't crash with no spoilerfile, fix unknown_get

This commit is contained in:
briaguya 2022-05-27 16:29:49 -04:00
commit 177211611d
2 changed files with 3 additions and 2 deletions

View file

@ -510,6 +510,7 @@ std::unordered_map<std::string, RandomizerGet> SpoilerfileGetNameToEnum = {
void Randomizer::PopulateItemLocations(std::string spoilerFileName) {
// todo pull this in from cvar or something
std::ifstream spoilerFileStream("spoiler.json");
if (!spoilerFileStream) return;
json spoilerFileJson;
spoilerFileStream >> spoilerFileJson;
json locationsJson = spoilerFileJson["locations"];

View file

@ -278,6 +278,7 @@ typedef enum {
// based on https://github.com/TestRunnerSRL/OoT-Randomizer/blob/e337d7f603b91a6bacb618fb32cc7fd70ed9ffca/ItemList.py
typedef enum {
UNKNOWN_GET = 0,
BOMBS_5,
DEKU_NUTS_5,
BOMBCHUS_10,
@ -499,8 +500,7 @@ typedef enum {
WATER_MEDALLION,
SPIRIT_MEDALLION,
SHADOW_MEDALLION,
LIGHT_MEDALLION,
UNKNOWN_GET
LIGHT_MEDALLION
} RandomizerGet;
class Randomizer {