summaryrefslogtreecommitdiffstats
path: root/src/core/FileLoader.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2021-01-24 13:40:33 +0100
committeraap <aap@papnet.eu>2021-01-24 13:47:33 +0100
commit8cbae5d62afa975a51ce7ec9be3018b473d81011 (patch)
tree0f7b165687fe4305528a0410f816dfde093676ae /src/core/FileLoader.cpp
parentCBaseModelInfo (diff)
downloadre3-8cbae5d62afa975a51ce7ec9be3018b473d81011.tar
re3-8cbae5d62afa975a51ce7ec9be3018b473d81011.tar.gz
re3-8cbae5d62afa975a51ce7ec9be3018b473d81011.tar.bz2
re3-8cbae5d62afa975a51ce7ec9be3018b473d81011.tar.lz
re3-8cbae5d62afa975a51ce7ec9be3018b473d81011.tar.xz
re3-8cbae5d62afa975a51ce7ec9be3018b473d81011.tar.zst
re3-8cbae5d62afa975a51ce7ec9be3018b473d81011.zip
Diffstat (limited to 'src/core/FileLoader.cpp')
-rw-r--r--src/core/FileLoader.cpp35
1 files changed, 26 insertions, 9 deletions
diff --git a/src/core/FileLoader.cpp b/src/core/FileLoader.cpp
index c13252f6..eed12e58 100644
--- a/src/core/FileLoader.cpp
+++ b/src/core/FileLoader.cpp
@@ -607,11 +607,14 @@ CFileLoader::LoadObjectTypes(const char *filename)
int section;
int pathIndex;
int id, pathType;
- int minID, maxID;
+ //int minID, maxID;
+
+ for(int i = 0; i < ARRAY_SIZE(m_sTempIdeData); i++)
+ m_sTempIdeData[i].id = -1;
section = NONE;
- minID = INT32_MAX;
- maxID = -1;
+ //minID = INT32_MAX;
+ //maxID = -1;
pathIndex = -1;
debug("Loading object types from %s...\n", filename);
@@ -635,13 +638,13 @@ CFileLoader::LoadObjectTypes(const char *filename)
}else switch(section){
case OBJS:
id = LoadObject(line);
- if(id > maxID) maxID = id;
- if(id < minID) minID = id;
+ //if(id > maxID) maxID = id;
+ //if(id < minID) minID = id;
break;
case TOBJ:
id = LoadTimeObject(line);
- if(id > maxID) maxID = id;
- if(id < minID) minID = id;
+ //if(id > maxID) maxID = id;
+ //if(id < minID) minID = id;
break;
case WEAP:
LoadWeaponObject(line);
@@ -678,10 +681,10 @@ CFileLoader::LoadObjectTypes(const char *filename)
}
CFileMgr::CloseFile(fd);
- for(id = minID; id <= maxID; id++){
+ for(id = 0; id < MODELINFOSIZE; id++){
CSimpleModelInfo *mi = (CSimpleModelInfo*)CModelInfo::GetModelInfo(id);
if(mi && mi->IsBuilding())
- mi->SetupBigBuilding(minID, maxID);
+ mi->SetupBigBuilding();
}
}
@@ -714,6 +717,13 @@ CFileLoader::LoadObject(const char *line)
if(sscanf(line, "%d %s %s %d", &id, model, txd, &numObjs) != 4)
return 0; // game returns return value
+ for(int i = 0; i < ARRAY_SIZE(m_sTempIdeData); i++)
+ if(m_sTempIdeData[i].id == -1){
+ m_sTempIdeData[i].id = id;
+ strcpy(m_sTempIdeData[i].name, model);
+ break;
+ }
+
switch(numObjs){
case 1:
sscanf(line, "%d %s %s %d %f %d",
@@ -762,6 +772,13 @@ CFileLoader::LoadTimeObject(const char *line)
if(sscanf(line, "%d %s %s %d", &id, model, txd, &numObjs) != 4)
return 0; // game returns return value
+ for(int i = 0; i < ARRAY_SIZE(m_sTempIdeData); i++)
+ if(m_sTempIdeData[i].id < 0){
+ m_sTempIdeData[i].id = id;
+ strcpy(m_sTempIdeData[i].name, model);
+ break;
+ }
+
switch(numObjs){
case 1:
sscanf(line, "%d %s %s %d %f %d %d %d",