Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions logic/Entrance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Entrance::Entrance(Area* parentArea_, Area* connectedArea_, World* world_) :
alreadySetOriginalConnectedArea(true),
world(world_)
{
worldId = world->getWorldId();
setOriginalName();
requirement = Requirement();
requirement.type = RequirementType::NOTHING;
Expand Down Expand Up @@ -197,16 +196,6 @@ bool Entrance::hasWindWarp() const
return windWarp;
}

int Entrance::getWorldId() const
{
return worldId;
}

void Entrance::setWorldId(int& newWorldId)
{
worldId = newWorldId;
}

Entrance* Entrance::getReverse()
{
return reverse;
Expand Down Expand Up @@ -346,9 +335,9 @@ Entrance* Entrance::assumeReachable()

bool Entrance::operator<(const Entrance& rhs) const
{
if (this->worldId != rhs.worldId)
if (this->world->getWorldId() != rhs.world->getWorldId())
{
return this->worldId < rhs.worldId;
return this->world->getWorldId() < rhs.world->getWorldId();
}

return PointerLess<Area>{}(this->parentArea, rhs.parentArea);
Expand Down Expand Up @@ -516,4 +505,4 @@ std::string EntrancePath::to_string() const
returnStr += entrance->getOriginalName() + "\n";
}
return returnStr;
}
}
5 changes: 1 addition & 4 deletions logic/Entrance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ class Entrance
bool needsSavewarp() const;
void setWindWarp(const bool& windWarp_);
bool hasWindWarp() const;
int getWorldId() const;
void setWorldId(int& newWorldId);
Entrance* getReverse();
void setReverse(Entrance* reverseEntrance);
Entrance* getReplaces();
Expand Down Expand Up @@ -120,7 +118,6 @@ class Entrance
uint8_t spawnId = 0xFF;
bool savewarp = false;
bool windWarp = false;
int worldId = -1;
Entrance* reverse = nullptr;
Entrance* replaces = nullptr;
Entrance* assumed = nullptr;
Expand Down Expand Up @@ -166,4 +163,4 @@ struct EntrancePath {

bool isBetterThan(const EntrancePath& other, const std::string& curArea = "");
std::string to_string() const;
};
};
4 changes: 2 additions & 2 deletions logic/SpoilerLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ static std::string getSpoilerFormatEntrance(Entrance* entrance, const size_t& lo
{
// Print the world number if more than 1 world
std::string worldNumber = " [W";
worldNumber = worlds.size() > 1 ? worldNumber + std::to_string(entrance->getWorldId() + 1) + "]" : "";
worldNumber = worlds.size() > 1 ? worldNumber + std::to_string(entrance->getWorld()->getWorldId() + 1) + "]" : "";

auto currentEntranceName = entrance->getOriginalName(true);
// Add an extra space if the world id is only 1 digit
size_t numSpaces = (longestEntranceLength - currentEntranceName.length()) + ((entrance->getWorldId() >= 9) ? 0 : 1);
size_t numSpaces = (longestEntranceLength - currentEntranceName.length()) + ((entrance->getWorld()->getWorldId() >= 9) ? 0 : 1);
std::string spaces (numSpaces, ' ');

auto replacement = entrance->getReplaces()->getOriginalName();
Expand Down
1 change: 0 additions & 1 deletion logic/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,6 @@ World::WorldLoadingError World::loadExit(const std::string& connectedArea, const
AREA_VALID_CHECK(connectedArea, "Connected area of name \"" << connectedArea << "\" does not exist!");
loadedExit.setParentArea(getArea(parentArea));
loadedExit.setConnectedArea(getArea(connectedArea));
loadedExit.setWorldId(worldId);
loadedExit.setWorld(this);
// load exit requirements
if(const RequirementError err = parseRequirementString(logicExpression, loadedExit.getRequirement(), this); err != RequirementError::NONE)
Expand Down
Loading