summaryrefslogtreecommitdiffstats
path: root/src/modelinfo/ModelInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-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 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;