Skip to content

Commit

Permalink
Workaround for matching constant SNIPER (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
thelink2012 committed Nov 6, 2016
1 parent f4fd61d commit 4b1684b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,15 @@ optional<int32_t> Commands::find_constant(const string_view& value, bool context

optional<int32_t> Commands::find_constant_all(const string_view& value) const
{
// See https://github.com/thelink2012/gta3sc/issues/60
if(auto opt = enum_carpedmodels->find(value))
return opt;

// TODO mayyybe speed up this? we didn't profile or anything.
for(auto& enum_pair : enums)
{
if(&enum_pair.second == &enum_carpedmodels)
continue;
if(auto opt = enum_pair.second->find(value))
return opt;
}
Expand Down

0 comments on commit 4b1684b

Please sign in to comment.