Persist the current map name in the save slot
mapSetMap() now keeps SAVE.slot.cachedData.mapName in sync with the active map, so whichever map is loaded gets written out next time the slot is actually saved.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "rpg/entity/global/entityglobal.h"
|
||||
#include "rpg/entity/item/entityitem.h"
|
||||
#include "rpg/overworld/maparea.h"
|
||||
#include "save/save.h"
|
||||
|
||||
map_t MAP;
|
||||
|
||||
@@ -48,6 +49,10 @@ errorret_t mapSetMap(const char_t *map) {
|
||||
memoryZero(&MAP, sizeof(map_t));
|
||||
stringCopy(MAP.name, map, MAP_NAME_MAX);
|
||||
|
||||
// Keep the current save slot's cached map name in sync so whichever map
|
||||
// is active gets persisted next time the slot is actually saved.
|
||||
stringCopy(SAVE.slot.cachedData.mapName, MAP.name, MAP_NAME_MAX);
|
||||
|
||||
chunkindex_t i = 0;
|
||||
for(chunkunit_t z = 0; z < MAP_CHUNK_DEPTH; z++) {
|
||||
for(chunkunit_t y = 0; y < MAP_CHUNK_HEIGHT; y++) {
|
||||
|
||||
Reference in New Issue
Block a user