Skip to content

Commit cb22cb8

Browse files
authored
Merge pull request #103 from theobori/fix/mapconverter
fix(storage): Fixed data storage folder path
2 parents acc2117 + 2d3c047 commit cb22cb8

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
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 & 5 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
{
@@ -918,11 +917,13 @@ int CMapConverter::AddEmbeddedImage(const char *pImageName, int Width, int Heigh
918917
CImageInfo img;
919918
CImageInfo *pImg = &img;
920919

921-
char aBuf[512];
922-
str_format(aBuf, sizeof(aBuf), "data/mapres/%s.png", pImageName);
920+
char aBuf[256];
921+
str_format(aBuf, sizeof(aBuf), "mapres/%s.png", pImageName);
923922

924-
if(!LoadPNG(pImg, aBuf))
925-
{
923+
char aFullPath[512];
924+
m_pStorage->GetDataPath(aBuf, aFullPath, sizeof(aFullPath));
925+
926+
if (!LoadPNG(pImg, aFullPath)) {
926927
return -1;
927928
}
928929

0 commit comments

Comments
 (0)