diff options
author | Sergeanur <s.anureev@yandex.ua> | 2021-01-11 18:53:15 +0100 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-01-11 18:53:15 +0100 |
commit | a223157000fac3ba63699f04bc9e466f53a412e3 (patch) | |
tree | 54e1e672a564ffdb5d65e0748a86fae60f3eb895 /src/modelinfo/ModelInfo.cpp | |
parent | of course (diff) | |
download | re3-a223157000fac3ba63699f04bc9e466f53a412e3.tar re3-a223157000fac3ba63699f04bc9e466f53a412e3.tar.gz re3-a223157000fac3ba63699f04bc9e466f53a412e3.tar.bz2 re3-a223157000fac3ba63699f04bc9e466f53a412e3.tar.lz re3-a223157000fac3ba63699f04bc9e466f53a412e3.tar.xz re3-a223157000fac3ba63699f04bc9e466f53a412e3.tar.zst re3-a223157000fac3ba63699f04bc9e466f53a412e3.zip |
Diffstat (limited to 'src/modelinfo/ModelInfo.cpp')
-rw-r--r-- | src/modelinfo/ModelInfo.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modelinfo/ModelInfo.cpp b/src/modelinfo/ModelInfo.cpp index 0a542cf6..02df1be6 100644 --- a/src/modelinfo/ModelInfo.cpp +++ b/src/modelinfo/ModelInfo.cpp @@ -4,6 +4,7 @@ #include "TempColModels.h" #include "ModelIndices.h" #include "ModelInfo.h" +#include "KeyGen.h" // --MIAMI: file done @@ -186,10 +187,11 @@ CModelInfo::AddVehicleModel(int id) CBaseModelInfo* CModelInfo::GetModelInfo(const char *name, int *id) { + uint32 hashKey = CKeyGen::GetUppercaseKey(name); CBaseModelInfo *modelinfo; for(int i = 0; i < MODELINFOSIZE; i++){ modelinfo = CModelInfo::ms_modelInfoPtrs[i]; - if(modelinfo && !CGeneral::faststricmp(modelinfo->GetModelName(), name)){ + if(modelinfo && hashKey == modelinfo->GetNameHashKey()){ if(id) *id = i; return modelinfo; @@ -201,13 +203,14 @@ CModelInfo::GetModelInfo(const char *name, int *id) CBaseModelInfo* CModelInfo::GetModelInfo(const char *name, int minIndex, int maxIndex) { + uint32 hashKey = CKeyGen::GetUppercaseKey(name); if (minIndex > maxIndex) return 0; CBaseModelInfo *modelinfo; for(int i = minIndex; i <= maxIndex; i++){ modelinfo = CModelInfo::ms_modelInfoPtrs[i]; - if(modelinfo && !CGeneral::faststricmp(modelinfo->GetModelName(), name)) + if(modelinfo && hashKey == modelinfo->GetNameHashKey()) return modelinfo; } return nil; |