Still crashing in an executed thread.
private static method onLoad takes nothing returns nothing
local File file = File.open("SoT", "Savecodes",File.Flag.READ)
local integer i
local integer slot = slotSync
local string s
local BigInt bI
local player GP = GPsync
local thistype this
local NumberStack stack
set i = 0
if slot != 1 then
loop
call file.read()
set i = i + 1
exitwhen i == (slot*2)-1
endloop
endif
call print("Crash here?")
set s = (file.read())
set bI = BitInt.convertString(s,6)
call print("well its crashing anyway")
set this = allocate(1)
call synchronize()
call print("right?")
call print(I2S(read(0,6)))
call TriggerSyncReady()
call print("Crash here?")
if (0<StringLength(s)) then
set stack = DecryptNumber(s, encryptionKey, 1000000,/*
shuffles used in encryption played id to decrypt for
*/ 3, GetPlayerId(GP),/*
password used in encryption don't change
*/ "salt value", .85)
if (0!=stack) then
// call RemoveUnit(udg_PlayerUnit[GetConvertedPlayerId(GP)])
// call LoadHero(stack, GP)
// call SetHeroMain(GetLastCreatedUnit(),GP)
// call LoadCustomInventory(stack, GP)
// call LoadGold(stack, GP)
// call SetHeroLevel(udg_PlayerUnit[GetConvertedPlayerId(GP)], stack.pop(4000), false)
// call LoadInventory(stack, udg_PlayerUnit[GetConvertedPlayerId(GP)], Items.catalog)
call DisplayTimedTextToPlayer(GP,0,0,60,"Loaded Successfully!")
else
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,60,"Invalid Code")
endif
else
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,60,"Invalid Code")
endif
call print(s)
endmethod
elseif currentMenu[play] >= 3 then
set GPsync = GP
set slotSync = slot
call ExecuteFunc(thistype.onLoad.name)