Fix a few bugs

This commit is contained in:
Miloslav Ciz 2025-06-25 16:55:30 +02:00
parent f0e7ca8e33
commit 1b363995a6
5 changed files with 57 additions and 55 deletions

10
map.h
View file

@ -452,6 +452,11 @@ uint8_t LCR_mapLoadFromStr(char (*getNextCharFunc)(void), const char *name)
{
LCR_LOG0("loading map string");
LCR_LOG2("clearing map block cache")
for (int i = 0; i < LCR_MAP_BLOCK_CACHE_SIZE; ++i)
_LCR_mapBlockCache[i] = 0xfffffffe;
for (int i = 0; i < LCR_MAP_NAME_MAX_LEN; ++i)
{
LCR_currentMap.name[i] = *name;
@ -705,11 +710,6 @@ uint8_t LCR_mapLoadFromStr(char (*getNextCharFunc)(void), const char *name)
c = getNextCharFunc();
}
LCR_LOG2("clearing map block cache")
for (int i = 0; i < LCR_MAP_BLOCK_CACHE_SIZE; ++i)
_LCR_mapBlockCache[i] = 0xfffffffe;
_LCR_mapComputeHash();
LCR_LOG1("map loaded, block count/hash:")