Skip to content

Commit

Permalink
state: Actually fix the off-by-one correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
leoetlino committed Sep 2, 2019
1 parent 505aa6b commit 9a244c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/game/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ static constexpr StateInfo ex_state_info_table[] = {
template <typename Predicate>
static const StateInfo* FindStateInfo(Predicate predicate) {
const auto* table = rst::util::GetPointer<StateInfo>(0x6883FC);
auto it = std::find_if(table, table + 10, predicate);
if (it != table + 9)
const auto* table_end = table + 10;
auto it = std::find_if(table, table_end, predicate);
if (it != table_end)
return it;

// Search for extensions.
Expand Down

0 comments on commit 9a244c0

Please sign in to comment.