Skip to content

Commit

Permalink
Correctly pass symbolic constants to fstream::seekg
Browse files Browse the repository at this point in the history
  • Loading branch information
fungos committed Apr 29, 2018
1 parent 2d6ce35 commit 55b411f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions OrionUO/Managers/FileManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ void CFileManager::ReadTask()
animFile->read(signature, 4);
animFile->read(nextBlock, 8);

animFile->seekg(*reinterpret_cast<unsigned long long*>(nextBlock), 0);
animFile->seekg(*reinterpret_cast<unsigned long long*>(nextBlock), std::ios::beg);

do
{
Expand Down Expand Up @@ -493,7 +493,7 @@ void CFileManager::ReadTask()
hashes[hashVal] = dataStruct;
}

animFile->seekg(*reinterpret_cast<unsigned long long*>(nextBlock), 0);
animFile->seekg(*reinterpret_cast<unsigned long long*>(nextBlock), std::ios::beg);
} while (*reinterpret_cast<unsigned long long*>(nextBlock) != 0);
}

Expand Down Expand Up @@ -547,7 +547,7 @@ bool CFileManager::FileExists(const std::string& filename)
char *CFileManager::ReadUOPDataFromFileStream(UOPAnimationData &animData)
{
animData.fileStream->clear();
animData.fileStream->seekg(animData.offset, 0);
animData.fileStream->seekg(animData.offset, std::ios::beg);
//reading into buffer on the heap
char *buf = new char[animData.compressedLength];
animData.fileStream->read(buf, animData.compressedLength);
Expand Down Expand Up @@ -700,7 +700,7 @@ void CFileManager::ReadAnimMulDataFromFileStream(vector<char> &animData, CTextur
{
std::fstream* fileStream = &m_AnimMul[direction.FileIndex];
fileStream->clear();
fileStream->seekg(direction.Address, 0);
fileStream->seekg(direction.Address, std::ios::beg);
fileStream->read(static_cast<char*>(animData.data()), direction.Size);
}
//----------------------------------------------------------------------------------

0 comments on commit 55b411f

Please sign in to comment.