Skip to content

Commit 0a65107

Browse files
authored
bugfix(watertracks): Correct the path handling for .wak files in the WaterTracksRenderSystem (#2634)
1 parent 3ca03de commit 0a65107

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -958,15 +958,13 @@ void WaterTracksRenderSystem::saveTracks()
958958
return;
959959

960960
AsciiString fileName=TheTerrainLogic->getSourceFilename();
961-
char path[256];
962-
963-
strlcpy(path, fileName.str(), ARRAY_SIZE(path));
964-
strlcat(path, ".wak", ARRAY_SIZE(path));
961+
FileSystem::removeExtension(fileName);
962+
fileName.concat(".wak");
965963

966964
WaterTracksObj *umod;
967965
Int trackCount=0;
968966

969-
FILE *fp=fopen(path,"wb");
967+
FILE *fp=fopen(fileName.str(), "wb");
970968

971969
if (fp)
972970
{
@@ -994,12 +992,10 @@ void WaterTracksRenderSystem::loadTracks()
994992
return;
995993

996994
AsciiString fileName=TheTerrainLogic->getSourceFilename();
997-
char path[256];
998-
999-
strlcpy(path, fileName.str(), ARRAY_SIZE(path));
1000-
strlcat(path, ".wak", ARRAY_SIZE(path));
995+
FileSystem::removeExtension(fileName);
996+
fileName.concat(".wak");
1001997

1002-
File *file = TheFileSystem->openFile(path, File::READ | File::BINARY);
998+
File *file = TheFileSystem->openFile(fileName.str(), File::READ | File::BINARY);
1003999
WaterTracksObj *umod;
10041000
Int trackCount=0;
10051001
Int flipU=0;

0 commit comments

Comments
 (0)