SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
85 stars 18 forks source link

GroupManager and LightingManager save doesn't close river #2666

Closed DiFFoZ closed 3 years ago

DiFFoZ commented 3 years ago

GroupManager and LightingManager save method doesn't close the river, this means that it doesn't save to the save-file

SDGNelson commented 3 years ago

Thanks for the report! That explains a few bugs. Sigh the old savedata code is such a mess. Will fix for the next update!

DiFFoZ commented 3 years ago

Also, may you add check if Level is loaded before saving

[2021-06-26 10:15:01 INF][SDG.Unturned] Loading level: 8%
[2021-06-26 10:15:02 INF][OpenMod.Core.Jobs.OpenModCommandTaskExecutor] An internal error occured during the command execution.
[2021-06-26 10:15:02 ERR][OpenMod.Core.Commands.CommandExecutor] Exception occured on command "save" by actor console/OpenModTaskExecutor (JobCommandActor)
System.NullReferenceException: Object reference not set to an instance of an object
  at SDG.Unturned.VehicleManager.save () [0x00058] in <38e32ec197e14c8996a0643157fe02bf>:0 
  at SDG.Unturned.SaveManager.save () [0x00067] in <38e32ec197e14c8996a0643157fe02bf>:0 
SDGNelson commented 3 years ago

Why is it saving before load?

DiFFoZ commented 3 years ago

Just cron executes save command each 5 minute

SDGNelson commented 3 years ago

Okay, will see about adding a check there as well.

SDGNelson commented 3 years ago

Should be resolved for this week's update.

DiFFoZ commented 3 years ago

image Checked again the save method and i notice that LevelManager.save is not used.

SDGNelson commented 3 years ago

Huh. I guess it was never used. 🤦‍♂️ Well, thankfully it is not important, and this sort of thing will be cleaned up with the savedata rewrites.