Freezing the data before cleanup obviously causes error when the cleanup would actually try to change something.
This in turn prevented old characters that did have limits set for unknown attributes from loading successfully.
Fixes the following crash:
Failed to load character c*** for access ***:
[TypeError: Cannot delete property 'Vagina_protruding' of #<Object>
at CleanupAssetPreferences (/app/node_modules/.pnpm/pandora-common@file+pandora-common/node_modules/pandora-common/src/character/assetPreferences.ts:111:22)
at AssetPreferencesSubsystemServer (/app/node_modules/.pnpm/pandora-common@file+pandora-common/node_modules/pandora-common/src/gameLogic/assetPreferences/assetPreferencesSubsystemServer.ts:25:26)
at GameLogicCharacterServer (/app/node_modules/.pnpm/pandora-common@file+pandora-common/node_modules/pandora-common/src/gameLogic/character/characterServer.ts:25:27)
at Character (/app/src/character/character.ts:202:29)
at CharacterManager.loadCharacter (/app/src/character/characterManager.ts:62:10)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Promise.all (index 11)
at SocketIODirectoryConnector.updateFromDirectory (/app/src/networking/socketio_directory_connector.ts:238:4)
at MessageHandler.onMessage (/app/node_modules/.pnpm/pandora-common@file+pandora-common/node_modules/pandora-common/src/networking/message_handler.ts:68:11)
]
Freezing the data before cleanup obviously causes error when the cleanup would actually try to change something. This in turn prevented old characters that did have limits set for unknown attributes from loading successfully.
Fixes the following crash: