diff --git a/assets.h b/assets.h index 4629aaa..06b853c 100644 --- a/assets.h +++ b/assets.h @@ -31,7 +31,7 @@ #define LCR_MODULE_NAME "asset" -#define LCR_VERSION "1.0" +#define LCR_VERSION "1.0d" static const char *LCR_texts[] = { diff --git a/game.h b/game.h index b1db32c..1ad5131 100644 --- a/game.h +++ b/game.h @@ -853,16 +853,21 @@ uint8_t LCR_gameLoadMap(unsigned int mapIndex) LCR_seekDataByIndex(mapIndex,'M'); - for (int i = 0; i < LCR_MAP_NAME_MAX_LEN; ++i) + int i = 0; + + while (1) { char c = LCR_gameGetNextDataFileChar(); - if (c == LCR_DATA_FILE_SEPARATOR2 || - c == LCR_DATA_FILE_SEPARATOR || c == 0) + if (c == LCR_DATA_FILE_SEPARATOR2 || c == LCR_DATA_FILE_SEPARATOR || c == 0) break; - name[i] = c; - name[i + 1] = 0; + if (i <= LCR_MAP_NAME_MAX_LEN) + { + name[i] = c; + name[i + 1] = 0; + i++; + } } result = LCR_mapLoadFromStr(LCR_gameGetNextDataStrChar,name);