Skip to content

Commit

Permalink
tile fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jonylu7 committed Jun 13, 2024
1 parent 5da849c commit 5642485
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 5 additions & 6 deletions include/Map/Tile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ class TileClass {
void pushAvatars(std::shared_ptr<Avatar> avatar) {
avatar->getMoving()->setStandingCorner(m_Avatars.size());
m_Avatars.push_back(avatar);
if (m_Avatars.size() == 4) {
setWalkable(false);
}
// if (m_Avatars.size() == 4) {
// setWalkable(false);
//}
}

std::vector<std::shared_ptr<Avatar>> getAvatars() { return m_Avatars; }
Expand Down Expand Up @@ -119,7 +119,7 @@ class TileClass {
}

bool ifEnemyAtTile(HouseType myHouse) {
if(myHouse==HouseType::MY){
if (myHouse == HouseType::MY) {
if (m_Structure->getID().getHouse() == HouseType::ENEMY) {
return true;
}
Expand All @@ -129,7 +129,7 @@ class TileClass {
}
}
return false;
}else if(myHouse==HouseType::ENEMY){
} else if (myHouse == HouseType::ENEMY) {
if (m_Structure->getID().getHouse() == HouseType::MY) {
return true;
}
Expand All @@ -142,7 +142,6 @@ class TileClass {
}
}


private:
bool m_TerrainBuildable;
bool m_TerrainWalkable;
Expand Down
3 changes: 3 additions & 0 deletions src/Mechanics/AvatarNavigator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ AvatarNavigator::moveAlongsideObstacle(Side side, glm::vec2 currentcell,
path.push_back(currentdir);
currentcell =
PathUtility::getNextCellByCurrent(currentdir, currentcell);
if (path.size() > 30) {
return path;
}
}

return path;
Expand Down

0 comments on commit 5642485

Please sign in to comment.