diff --git a/source/game/state.cpp b/source/game/state.cpp index 32d1dd6..f83a178 100644 --- a/source/game/state.cpp +++ b/source/game/state.cpp @@ -24,8 +24,9 @@ static constexpr StateInfo ex_state_info_table[] = { template static const StateInfo* FindStateInfo(Predicate predicate) { const auto* table = rst::util::GetPointer(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.