From 4b1684bff7eeb2e237c939579460d5a76f763589 Mon Sep 17 00:00:00 2001 From: "Denilson M. Amorim" Date: Sun, 6 Nov 2016 01:18:09 -0300 Subject: [PATCH] Workaround for matching constant SNIPER (#60) --- src/commands.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/commands.cpp b/src/commands.cpp index dfe93eb..69d37b4 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -88,9 +88,15 @@ optional Commands::find_constant(const string_view& value, bool context optional 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; }