Fix wmMapIdxToName
This commit is contained in:
parent
6de4ac87df
commit
b0b69bd780
|
@ -799,7 +799,7 @@ int mapLoadById(int map)
|
||||||
scriptSetFixedParam(gMapSid, map);
|
scriptSetFixedParam(gMapSid, map);
|
||||||
|
|
||||||
char name[16];
|
char name[16];
|
||||||
if (wmMapIdxToName(map, name) == -1) {
|
if (wmMapIdxToName(map, name, sizeof(name)) == -1) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2761,14 +2761,14 @@ int wmMapMaxCount()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 0x4BF974
|
// 0x4BF974
|
||||||
int wmMapIdxToName(int mapIdx, char* dest)
|
int wmMapIdxToName(int mapIdx, char* dest, size_t size)
|
||||||
{
|
{
|
||||||
if (mapIdx == -1 || mapIdx > wmMaxMapNum) {
|
if (mapIdx == -1 || mapIdx > wmMaxMapNum) {
|
||||||
dest[0] = '\0';
|
dest[0] = '\0';
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(dest, sizeof(dest), "%s.MAP", wmMapInfoList[mapIdx].mapFileName);
|
snprintf(dest, size, "%s.MAP", wmMapInfoList[mapIdx].mapFileName);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -237,7 +237,7 @@ int wmWorldMap_reset();
|
||||||
int wmWorldMap_save(File* stream);
|
int wmWorldMap_save(File* stream);
|
||||||
int wmWorldMap_load(File* stream);
|
int wmWorldMap_load(File* stream);
|
||||||
int wmMapMaxCount();
|
int wmMapMaxCount();
|
||||||
int wmMapIdxToName(int mapIdx, char* dest);
|
int wmMapIdxToName(int mapIdx, char* dest, size_t size);
|
||||||
int wmMapMatchNameToIdx(char* name);
|
int wmMapMatchNameToIdx(char* name);
|
||||||
bool wmMapIdxIsSaveable(int mapIdx);
|
bool wmMapIdxIsSaveable(int mapIdx);
|
||||||
bool wmMapIsSaveable();
|
bool wmMapIsSaveable();
|
||||||
|
|
Loading…
Reference in New Issue