# HG changeset patch # User Ritor1 # Date 1389872088 -21600 # Node ID 47ac9e87690c391225da680c30ea3867fe509c81 # Parent f5e9ac04dd25b3fe69afcfd8aded3d9e2c708aa9 isFileOpened diff -r f5e9ac04dd25 -r 47ac9e87690c Indoor.cpp --- a/Indoor.cpp Thu Jan 16 00:08:27 2014 +0600 +++ b/Indoor.cpp Thu Jan 16 17:34:48 2014 +0600 @@ -1892,7 +1892,7 @@ void *pRawDLV = nullptr; strcpy(&pFilename[strlen(pFilename) - 4], ".dlv"); - File = pNew_LOD->FindContainer(pFilename, 1); + File = pNew_LOD->FindContainer(pFilename, 1);//error on D28.dlv fread(&header, 0x10u, 1, File);//(FILE *)v245); bool _v244 = false; if (header.uVersion != 91969 || diff -r f5e9ac04dd25 -r 47ac9e87690c LOD.cpp --- a/LOD.cpp Thu Jan 16 00:08:27 2014 +0600 +++ b/LOD.cpp Thu Jan 16 17:34:48 2014 +0600 @@ -946,7 +946,7 @@ pSubIndices = NULL; pRoot = NULL; fclose(pFile); - isFileOpened = 0; + isFileOpened = false; _6A0CA8_lod_unused = 0; } } @@ -1517,7 +1517,7 @@ //insert new data in sorted index lod file bRewrite_data = false; insert_index=-1; - if (!isFileOpened) + if (!isFileOpened)//sometimes gives crash return 1; if ( !pSubIndices) return 2; @@ -1666,7 +1666,7 @@ else pFile = fopen(pFilename, "rb+"); if (!pFile) - return false; + return false;//начало ошибки в сохранении на data\new.lod strcpy(pLODName, pFilename); fread(&header, sizeof(LOD::FileHeader), 1, pFile); @@ -1778,7 +1778,7 @@ { fread(pRoot, sizeof(LOD::Directory), header.uNumIndices, pFile); fseek(pFile, 0, SEEK_SET); - isFileOpened = 1; + isFileOpened = true; return false; } else @@ -1810,16 +1810,13 @@ pRoot(nullptr), isFileOpened(false) { - LOD::File *v1; // esi@1 - memset(pLODName, 0, 256); memset(pContainerName, 0, 16); - v1 = this; - v1->pFile = 0; - v1->pSubIndices = 0; - v1->pIOBuffer = 0; - v1->isFileOpened = 0; - v1->uIOBufferSize = 0; + this->pFile = 0; + this->pSubIndices = 0; + this->pIOBuffer = 0; + this->isFileOpened = false; + this->uIOBufferSize = 0; Close(); } diff -r f5e9ac04dd25 -r 47ac9e87690c LOD.h --- a/LOD.h Thu Jan 16 00:08:27 2014 +0600 +++ b/LOD.h Thu Jan 16 17:34:48 2014 +0600 @@ -91,7 +91,7 @@ FILE *pFile; char pLODName[256]; - unsigned int isFileOpened; + bool isFileOpened; unsigned __int8 *pIOBuffer; unsigned int uIOBufferSize; struct FileHeader header; diff -r f5e9ac04dd25 -r 47ac9e87690c Outdoor.cpp --- a/Outdoor.cpp Thu Jan 16 00:08:27 2014 +0600 +++ b/Outdoor.cpp Thu Jan 16 17:34:48 2014 +0600 @@ -3855,7 +3855,7 @@ v2 = 0; fall_speed = 0; *(float *)&v128 = 0.0; - if ( v102 && pZ < ceiling_height && (signed int)(pParty->uPartyHeight + pZ) >= ceiling_height )//столкновение с потолком(ошибка) + if ( v102 && pZ < ceiling_height && (signed int)(pParty->uPartyHeight + pZ) >= ceiling_height )//столкновение с потолком { pParty->field_6E0 = 0; pParty->field_6E4 = 0; @@ -4133,6 +4133,7 @@ if ( pParty->bFlying ) { //v126 = stru_5C6E00->Cos(GetTickCount()); + v129 = fixpoint_mul(4, cosf(GetTickCount())); v129 = (unsigned __int64)(4i64 * stru_5C6E00->Cos(GetTickCount())) >> 16; pZ = v113 + v129; if ( pModel )