summaryrefslogtreecommitdiffstats
path: root/src/modelinfo/ModelInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modelinfo/ModelInfo.cpp')
-rw-r--r--src/modelinfo/ModelInfo.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modelinfo/ModelInfo.cpp b/src/modelinfo/ModelInfo.cpp
index 41515e20..47f4e309 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"
CBaseModelInfo *CModelInfo::ms_modelInfoPtrs[MODELINFOSIZE];
@@ -184,10 +185,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;
@@ -199,13 +201,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;