Skip to content

Commit

Permalink
another fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
brightrim committed Jan 2, 2025
1 parent 0f64502 commit 1be77d6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,15 @@ auto Player::lookIntoBackPack() -> bool {
return false;
}

bool Player::isIdInDepotArray(int itemId) {
for (const auto& DEPOTITEM : DEPOTITEMS) {
if (itemId == DEPOTITEM) {
return true;
}
}
return false;
}

auto Player::lookIntoContainerOnField(direction dir) -> bool {
position containerPosition = getPosition();
containerPosition.move(dir);
Expand All @@ -409,16 +418,6 @@ auto Player::lookIntoContainerOnField(direction dir) -> bool {
map::Field &field = World::get()->fieldAt(containerPosition);
Item item;

int isIdInDepotArray(int itemId) {
for (const auto& DEPOTITEM : DEPOTITEMS) {
if (itemId == DEPOTITEM) {
return true;
}
}
return false;
}


if (field.viewItemOnStack(item)) {
if (isIdInDepotArray(item.getId()) && item.isContainer()) {
auto it = field.containers.find(item.getNumber());
Expand Down
1 change: 1 addition & 0 deletions src/Player.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ class Player : public Character {
auto getScreenRange() const -> Coordinate override;

private:
bool isIdInDepotArray(int itemId);
std::set<uint32_t> visibleChars;
std::unordered_set<TYPE_OF_CHARACTER_ID> knownPlayers;
std::unordered_map<TYPE_OF_CHARACTER_ID, std::string> namedPlayers;
Expand Down

0 comments on commit 1be77d6

Please sign in to comment.