Skip to content

Commit e3e735c

Browse files
committed
Random Cleanups
- Use getProgressionLocations more - Make another Location member function const - Use int literal instead of bool for some setting defaults
1 parent 73d0231 commit e3e735c

6 files changed

Lines changed: 14 additions & 15 deletions

File tree

logic/Fill.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ void determineMajorItems(WorldPool& worlds, ItemPool& itemPool, LocationPool& al
339339
}
340340
for (auto& world : worlds)
341341
{
342-
for (auto& location : world.getLocations(true))
342+
for (auto& location : world.getProgressionLocations())
343343
{
344344
if (location->currentItem.getGameItemId() != GameItem::INVALID)
345345
{

logic/Hints.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static HintError calculatePossiblePathLocations(WorldPool& worlds)
5454
// and seeing if taking away the item at each location can still access the goal locations
5555
for (auto& world : worlds)
5656
{
57-
for (auto& potentialPathLocation : world.getLocations(true))
57+
for (auto& potentialPathLocation : world.getProgressionLocations())
5858
{
5959
const Item itemAtLocation = potentialPathLocation->currentItem;
6060
if (itemAtLocation.isJunkItem())
@@ -68,7 +68,7 @@ static HintError calculatePossiblePathLocations(WorldPool& worlds)
6868
// Run a search without the item
6969
runGeneralSearch(worlds);
7070

71-
for (auto& location : world.getLocations(true))
71+
for (auto& location : world.getProgressionLocations())
7272
{
7373
// If we never reached the goal location, then this location
7474
// is "on the path to" the goal location. Since hints will refer
@@ -85,7 +85,7 @@ static HintError calculatePossiblePathLocations(WorldPool& worlds)
8585
}
8686

8787
#ifdef ENABLE_DEBUG
88-
for (auto& location : world.getLocations(true))
88+
for (auto& location : world.getProgressionLocations())
8989
{
9090
LOG_TO_DEBUG("Path locations for " + location->getName() + " [");
9191
for (auto& pathLocation : location->pathLocations)
@@ -681,7 +681,7 @@ static HintError assignHoHoHints(World& world, WorldPool& worlds, std::list<Hint
681681
// If ho ho is hinting triforces, make those hints now
682682
if (world.getSettings().ho_ho_triforce_hints)
683683
{
684-
for (auto location : world.getLocations(/*onlyProgression =*/ true))
684+
for (const auto location : world.getProgressionLocations())
685685
{
686686
if (location->currentItem.isTriforceShard())
687687
{
@@ -765,7 +765,7 @@ static HintError assignKreebHints(World& world, WorldPool& worlds)
765765
// Get all bow locations
766766
// Shuffle locations to prevent any possible meta-gaming where the last bow might be
767767
// since otherwise they'll appear in order of location id
768-
auto allLocations = world.getLocations(/*onlyProgression = */ true);
768+
auto allLocations = world.getProgressionLocations();
769769
shufflePool(allLocations);
770770
for (auto& location : allLocations)
771771
{
@@ -782,7 +782,7 @@ static HintError assignKorlSwordHints(World& world, WorldPool& worlds)
782782
// Get all sword locations
783783
// Shuffle locations to prevent any possible meta-gaming where the swords bow might be
784784
// since otherwise they'll appear in order of location id
785-
auto allLocations = world.getLocations(/*onlyProgression = */ true);
785+
auto allLocations = world.getProgressionLocations();
786786
shufflePool(allLocations);
787787
for (auto& location : allLocations)
788788
{

logic/Location.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ bool Location::isBarrenAsChainLocation() const
190190
return !progression || (currentItem.canBeInBarrenRegion() && !isRequiredBossLocation);
191191
}
192192

193-
std::u16string Location::generateImportanceText(const std::string& language)
193+
std::u16string Location::generateImportanceText(const std::string& language) const
194194
{
195195
const Item& item = currentItem;
196196

logic/Location.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class Location
141141
bool operator<(const Location& rhs) const;
142142

143143
std::string getName() const;
144-
std::u16string generateImportanceText(const std::string& language);
144+
std::u16string generateImportanceText(const std::string& language) const;
145145
bool currentItemCanBeBarren() const;
146146
bool isBarrenAsChainLocation() const;
147147
};

options.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ void Settings::resetDefaultSettings() {
6666
kreeb_bow_hints = false;
6767
ho_ho_hints = false;
6868
ho_ho_triforce_hints = false;
69-
path_hints = false;
70-
barren_hints = false;
71-
item_hints = false;
72-
location_hints = false;
69+
path_hints = 0;
70+
barren_hints = 0;
71+
item_hints = 0;
72+
location_hints = 0;
7373
use_always_hints = false;
7474
clearer_hints = false;
7575
hint_importance = false;

tweaks.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,7 @@ TweakError update_ho_ho_dialog(World& world) {
13161316
}
13171317

13181318
TweakError update_kreeb_dialog(World& world) {
1319-
// Don't change text if theres no kreeb hints
1319+
// Don't change text if theres no Kreeb hints
13201320
if (world.kreebHints.empty()) {
13211321
return TweakError::NONE;
13221322
}
@@ -1348,7 +1348,6 @@ TweakError update_kreeb_dialog(World& world) {
13481348
}
13491349

13501350
TweakError rotate_ho_ho_to_face_hints(World& world) {
1351-
13521351
// If no ho ho hints, don't do anything
13531352
if (world.hohoHints.empty()) {
13541353
return TweakError::NONE;

0 commit comments

Comments
 (0)