summaryrefslogtreecommitdiff
path: root/src/control/Script5.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-01-12 13:22:44 +0200
committerGitHub <noreply@github.com>2021-01-12 13:22:44 +0200
commit8888ee3974587cfb6172e420210df75e5c5de3f7 (patch)
tree10294da8d82bcdedaaf64cee35897a7fe08b64ea /src/control/Script5.cpp
parentcb4b4d584c4d08791207ff92870b400a84faa742 (diff)
parent3e6eea25b3067bb02d6be8398817cd85dbc8de35 (diff)
Merge pull request #948 from Sergeanur/lcsPR/CutsceneMgr
CutsceneMgr done + use original VB audio + make interiors visible + use hashed model info names a bit
Diffstat (limited to 'src/control/Script5.cpp')
-rw-r--r--src/control/Script5.cpp24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/control/Script5.cpp b/src/control/Script5.cpp
index c0909356..c0e3ecad 100644
--- a/src/control/Script5.cpp
+++ b/src/control/Script5.cpp
@@ -2754,30 +2754,16 @@ void CTheScripts::ReadObjectNamesFromScript()
void CTheScripts::UpdateObjectIndices()
{
- char name[USED_OBJECT_NAME_LENGTH];
char error[112];
for (int i = 1; i < NumberOfUsedObjects; i++) {
- bool found = false;
- for (int j = 0; j < MODELINFOSIZE && !found; j++) {
- CBaseModelInfo* pModel = CModelInfo::GetModelInfo(j);
- if (!pModel)
- continue;
- strcpy(name, pModel->GetModelName());
-#ifdef FIX_BUGS
- for (int k = 0; k < USED_OBJECT_NAME_LENGTH && name[k]; k++)
-#else
- for (int k = 0; k < USED_OBJECT_NAME_LENGTH; k++)
-#endif
- name[k] = toupper(name[k]);
- if (strcmp(name, UsedObjectArray[i].name) == 0) {
- found = true;
- UsedObjectArray[i].index = j;
- }
- }
- if (!found) {
+ UsedObjectArray[i].index = -1;
+ CModelInfo::GetModelInfo(UsedObjectArray[i].name, &UsedObjectArray[i].index);
+#ifndef FINAL
+ if (UsedObjectArray[i].index == -1) {
sprintf(error, "CTheScripts::UpdateObjectIndices - Couldn't find %s", UsedObjectArray[i].name);
debug("%s\n", error);
}
+#endif
}
}