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