Issue Summary:
My friend runned my MorePlayers mod in modded realm. After we where done she went back to official realm and keeps crashing after the intro video.
Steps to Reproduce:
Start the game in official realm
crash
Reproduction Rate (Choose One):
Constant (100%)
Additional Information:
I am the creator of the mod MorePlayers mod and tested the mod a lot of times. But in a unknown way she manage to change the PlayerData.bot_spawn_priority in modded realm.
This variable contains now more values then expected. Now the official game can not handle this extra data it contains and crash the official game.
Hopefully you can fix her account.
PS: I made this mod now hidden, like no one else can get this issue.
--[[
Because the MorePlayers mod had a different ProfilePriority with more elements.
The bot_spawn_priority is in a rare case influenced by the ProfilePriority and adds more elements to this
data. The official game cant handle with these extra elements and crashes at start.
Fix:
- Before PlayerData is been saved check if the bot_spawn_priority has not to much elements
]]--
local mod = get_mod("MorePlayers")
mod:hook(SaveManager, "auto_save", function(func, self, file_name, data, ...)
mod:debug("SaveManager.auto_save()")
local all_players_data = data.player_data
for key, value in pairs(all_players_data) do
local player_data = all_players_data[key]
if player_data.bot_spawn_priority and #player_data.bot_spawn_priority > 5 then
player_data.bot_spawn_priority = {[1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5}
end
end
return func(self, file_name, data, ...)
end)
This is the fix i made. It prevents the modded realm to save to much elements in the PlayerData, like its cant corrupt the user anymore