Skip to content

Commit 4e2c3f4

Browse files
committed
fix(storage): Fixed data storage folder path
1 parent 868f4d4 commit 4e2c3f4

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ src/game/generated
2424
/bin/server_d
2525

2626
/bin/GeoLite2-Country.mmdb
27+
build
28+
__pycache__

src/engine/server/mapconverter.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ int CClientGameTileGetter::GetClientGameTileIndex(int TileX, int TileY) const
8686

8787
int LoadPNG(CImageInfo *pImg, const char *pFilename)
8888
{
89-
char aCompleteFilename[IO_MAX_PATH_LENGTH];
9089
IOHANDLE File = io_open(pFilename, IOFLAG_READ);
9190
if(File)
9291
{
@@ -910,10 +909,13 @@ int CMapConverter::AddEmbeddedImage(const char *pImageName, int Width, int Heigh
910909
CImageInfo img;
911910
CImageInfo *pImg = &img;
912911

913-
char aBuf[512];
914-
str_format(aBuf, sizeof(aBuf), "data/mapres/%s.png", pImageName);
912+
char aBuf[256];
913+
str_format(aBuf, sizeof(aBuf), "mapres/%s.png", pImageName);
914+
915+
char aFullPath[512];
916+
m_pStorage->GetDataPath(aBuf, aFullPath, sizeof(aFullPath));
915917

916-
if (!LoadPNG(pImg, aBuf)) {
918+
if (!LoadPNG(pImg, aFullPath)) {
917919
return -1;
918920
}
919921

0 commit comments

Comments
 (0)