Skip to content

Commit

Permalink
Cleanup comments inside Game_Map
Browse files Browse the repository at this point in the history
  • Loading branch information
florianessl committed Jan 19, 2025
1 parent 5c325d3 commit 50d6dc1
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/game_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -726,13 +726,12 @@ static bool WouldCollide(const Game_Character& self, const T& other, bool self_c
if (self.GetLayer() == other.GetLayer()) {
if constexpr (impl == Game_Map::eImpl_AssertWayBackground) {
// check if 'self' is blocked by player
// if the blocked movement doesn't occur in foreground
// context, then they could just walk away
// (if the blocked movement doesn't occur inside
// 'foreground' context, then they might just walk away)

if (other.GetType() == Game_Character::Player) {
return false;
}
//TODO: should maybe check if offscreen
if (other.GetType() == Game_Character::Vehicle) {
return false;
}
Expand Down Expand Up @@ -762,26 +761,25 @@ static bool WouldCollide(const Game_Character& self, const T& other, bool self_c
auto* page = reinterpret_cast<Game_Event const&>(other).GetActivePage();
auto move_type = page ? page->move_type : 0;

//TODO: only when !main_flag
if (move_type == lcf::rpg::EventPage::MoveType_vertical) {
//check if other event culd still move up/down...
//check if 'other' event could still move up/down...
if (Game_Map::CheckWay(other, other.GetX(), other.GetY(), other.GetX(), other.GetY() + other.GetDyFromDirection(Game_Character::Up), true, &ignore_list)
|| Game_Map::CheckWay(other, other.GetX(), other.GetY(), other.GetX(), other.GetY() + other.GetDyFromDirection(Game_Character::Down), true, &ignore_list)) {
return false;
}
} else if (move_type == lcf::rpg::EventPage::MoveType_horizontal) {
//check if other event culd still move left/right...
//check if 'other' event could still move left/right...
if (Game_Map::CheckWay(other, other.GetX(), other.GetY(), other.GetX() + other.GetDxFromDirection(Game_Character::Left), other.GetY(), true, &ignore_list)
|| Game_Map::CheckWay(other, other.GetX(), other.GetY(), other.GetX() + other.GetDxFromDirection(Game_Character::Right), other.GetY(), true, &ignore_list)) {
return false;
}
} else if (std::any_of(rng_moves.begin(), rng_moves.end(), [&move_type](auto mt) { return move_type == mt; })) {
//check if other event culd still move in any direction...
//check if 'other' event could still move in any direction...
if (check_rng_move(other, &ignore_list)) {
return false;
}
} else if (move_type == lcf::rpg::EventPage::MoveType_custom) {
//check if other events custom route would make it possible for this event to move...
//check if the other event's custom route would make it possible for this event to move...
do_check_next_move_command = true;
}
}
Expand Down

0 comments on commit 50d6dc1

Please sign in to comment.