Skip to content

Commit

Permalink
fix(storage): Fixed data storage folder path
Browse files Browse the repository at this point in the history
  • Loading branch information
theobori committed Nov 8, 2024
1 parent 868f4d4 commit 4e2c3f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ src/game/generated
/bin/server_d

/bin/GeoLite2-Country.mmdb
build
__pycache__
10 changes: 6 additions & 4 deletions src/engine/server/mapconverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ int CClientGameTileGetter::GetClientGameTileIndex(int TileX, int TileY) const

int LoadPNG(CImageInfo *pImg, const char *pFilename)
{
char aCompleteFilename[IO_MAX_PATH_LENGTH];
IOHANDLE File = io_open(pFilename, IOFLAG_READ);
if(File)
{
Expand Down Expand Up @@ -910,10 +909,13 @@ int CMapConverter::AddEmbeddedImage(const char *pImageName, int Width, int Heigh
CImageInfo img;
CImageInfo *pImg = &img;

char aBuf[512];
str_format(aBuf, sizeof(aBuf), "data/mapres/%s.png", pImageName);
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "mapres/%s.png", pImageName);

char aFullPath[512];
m_pStorage->GetDataPath(aBuf, aFullPath, sizeof(aFullPath));

if (!LoadPNG(pImg, aBuf)) {
if (!LoadPNG(pImg, aFullPath)) {
return -1;
}

Expand Down

0 comments on commit 4e2c3f4

Please sign in to comment.