correctly handle vanilla/mq dungeon location exclusions (#2726)

The logic for showing/hiding Vanilla/MQ dungeon locations in the exclusion tab was not accounting for the case if MQ dungeons is set to "Random".

This rewrites the logic check to account for all 3 cases, and only looks at the count value when set to "Set Number".
Also the CVar get for MQ count needs to default to 12 instead 0, to match the declared default behavior everywhere else.
This commit is contained in:
Adam Bird 2023-04-20 20:58:43 -04:00 committed by GitHub
parent 37390c441f
commit 7d20509b5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -925,8 +925,11 @@ void RandomizerCheckObjects::UpdateImGuiVisibility() {
(locationIt.rc != RC_UNKNOWN_CHECK) &&
(!RandomizerCheckObjects::AreaIsDungeon(locationIt.rcArea) ||
locationIt.vOrMQ == RCVORMQ_BOTH ||
locationIt.vOrMQ == RCVORMQ_MQ && CVarGetInteger("gRandomizeMqDungeons", RO_MQ_DUNGEONS_NONE) != RO_MQ_DUNGEONS_NONE && CVarGetInteger("gRandomizeMqDungeonCount", 0) > 0 || // at least one MQ dungeon
locationIt.vOrMQ == RCVORMQ_VANILLA && (CVarGetInteger("gRandomizeMqDungeons", RO_MQ_DUNGEONS_NONE) == RO_MQ_DUNGEONS_NONE || CVarGetInteger("gRandomizeMqDungeonCount", 0) < 12) // at least one vanilla dungeon
locationIt.vOrMQ == RCVORMQ_MQ &&
((CVarGetInteger("gRandomizeMqDungeons", RO_MQ_DUNGEONS_NONE) == RO_MQ_DUNGEONS_SET_NUMBER && (CVarGetInteger("gRandomizeMqDungeonCount", 12) > 0) || // at least one MQ dungeon
CVarGetInteger("gRandomizeMqDungeons", RO_MQ_DUNGEONS_NONE) == RO_MQ_DUNGEONS_RANDOM_NUMBER)) ||
locationIt.vOrMQ == RCVORMQ_VANILLA &&
(CVarGetInteger("gRandomizeMqDungeons", RO_MQ_DUNGEONS_NONE) != RO_MQ_DUNGEONS_SET_NUMBER || CVarGetInteger("gRandomizeMqDungeonCount", 12) < 12) // at least one vanilla dungeon
) &&
(locationIt.rcType != RCTYPE_SHOP || CVarGetInteger("gRandomizeShopsanity", RO_SHOPSANITY_OFF) > RO_SHOPSANITY_ZERO_ITEMS) &&
(locationIt.rcType != RCTYPE_SCRUB || CVarGetInteger("gRandomizeShuffleScrubs", RO_SCRUBS_OFF) != RO_SCRUBS_OFF ||