mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-04-28 13:17:58 +03:00
Merge ba7e3afaf4
into fbbfc07ff1
This commit is contained in:
commit
b514fd1967
1 changed files with 4 additions and 6 deletions
|
@ -327,13 +327,12 @@ bool IsBeatableWithout(RandomizerCheck excludedCheck, bool replaceItem,
|
|||
auto ctx = Rando::Context::GetInstance();
|
||||
RandomizerGet copy = ctx->GetItemLocation(excludedCheck)->GetPlacedRandomizerGet(); // Copy out item
|
||||
ctx->GetItemLocation(excludedCheck)->SetPlacedItem(RG_NONE); // Write in empty item
|
||||
ctx->playthroughBeatable = false;
|
||||
logic->Reset();
|
||||
CheckBeatable(ignore);
|
||||
bool result = CheckBeatable(ignore);
|
||||
if (replaceItem) {
|
||||
ctx->GetItemLocation(excludedCheck)->SetPlacedItem(copy); // Immediately put item back
|
||||
}
|
||||
return ctx->playthroughBeatable;
|
||||
return result;
|
||||
}
|
||||
|
||||
// Reset non-Logic-class logic, and optionally apply the initial inventory
|
||||
|
@ -581,6 +580,7 @@ void GeneratePlaythrough() {
|
|||
// return if the seed is currently beatable or not
|
||||
bool CheckBeatable(RandomizerGet ignore /* = RG_NONE*/) {
|
||||
auto ctx = Rando::Context::GetInstance();
|
||||
ctx->playthroughBeatable = false;
|
||||
GetAccessibleLocationsStruct gals(0);
|
||||
ResetLogic(ctx, gals, true);
|
||||
do {
|
||||
|
@ -929,10 +929,8 @@ static void AssumedFill(const std::vector<RandomizerGet>& items, const std::vect
|
|||
// If ALR is off, then we check beatability after placing the item.
|
||||
// If the game is beatable, then we can stop placing items with logic.
|
||||
if (!ctx->GetOption(RSK_ALL_LOCATIONS_REACHABLE)) {
|
||||
ctx->playthroughBeatable = false;
|
||||
logic->Reset();
|
||||
CheckBeatable();
|
||||
if (ctx->playthroughBeatable) {
|
||||
if (CheckBeatable()) {
|
||||
SPDLOG_DEBUG("Game beatable, now placing items randomly. " + std::to_string(itemsToPlace.size()) +
|
||||
" major items remaining.\n\n");
|
||||
FastFill(itemsToPlace, GetEmptyLocations(allowedLocations), true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue