feat(protection): model mismatch (#1014)

This commit is contained in:
Aure7138 2023-02-22 17:23:47 +08:00 committed by GitHub
parent 79e53211c6
commit 88addc5c7e

View File

@ -55,11 +55,16 @@ namespace big
return nullptr;
}
static bool is_model_of_type(const rage::joaat_t hash, const eModelType type)
template<typename T, typename ...Args>
static bool is_model_of_type(const rage::joaat_t hash, const T arg, const Args... args)
{
if (const auto model = model_info::get_model(hash); model && model->m_model_type == type)
return true;
return false;
bool of_type = false;
if (const auto model = model_info::get_model(hash))
{
of_type = model->m_model_type == arg;
([&of_type, &model](eModelType type) { of_type |= model->m_model_type == type; }(args), ...);
}
return of_type;
}
};
}