TheResimulators / Sim-U-Kraft-Resimulated-1.16

Rewrite of the mod Sim-U-Kraft for 1.15
GNU General Public License v3.0
12 stars 8 forks source link

Factions doesn't save changes to its data. #123

Closed aidie8 closed 1 year ago

aidie8 commented 1 year ago

There is a certain process to how faction data is save

  1. Firstly you have SavedWorldData, this contains all the factions and has methods to add, remove, get, create factions, as well as adding removing players, there is a few more functionalities that allow you to get a faction with a certain player, sim, ,or UUID
  2. This Also controls when data from the factions are written to disk, when adding, removing a faction or player it uses the SetDirty() method which marks the data to be saved to disk, because we only ever modify the data from within the faction class this is never called, causing changes to the faction to not be saved

    effects

    this causes when sims get removed or data changed, that data change does not get changed causes a lot of issue such as

  3. ghost sims that do not exist because they are dead,
  4. Houses that have been removed or added not existing even if they are empty
  5. unloaded sims not being marked as unloaded causing issues with getting their data
  6. probably affecting the AI's After load Such as in #120
  7. probably more bugs that have not been found yet
aidie8 commented 1 year ago

This should mostly be fixed in the recent commits such as 444594e , should have fixed these issues

aidie8 commented 1 year ago

This seems to be fixed by my testing, there maybe more bugs that I haven't found that a new issue can be created for