Open hhyzbd opened 7 months ago
After a machine is destroyed, loading a save that still has this machine alive will cause pawns trying to rebuild this machine at its base.
After digging through the code, I noticed that cachedChargingStations and cachedChargingStationsDict didn't remove cached items. https://github.com/Vanilla-Expanded/VanillaExpandedFramework/blob/f7abe05737e4f216ad14198ce6c5489b784f1e1b/Source/VFECore/VFECore/Comps/ThingComps/CompMachineChargingStation.cs#L24-L25 cachedChargingStations allows duplication. cachedChargingStationsDict recognize same thing in different states as different keys. I think making cachedChargingStationsDict a Dictionary<ThingID, CompMachineChargingStation> will prevent this issue, but cached items still get kept between saves.
cachedChargingStations
cachedChargingStationsDict
thing
Dictionary<ThingID, CompMachineChargingStation>
After a machine is destroyed, loading a save that still has this machine alive will cause pawns trying to rebuild this machine at its base.
After digging through the code, I noticed that
cachedChargingStations
andcachedChargingStationsDict
didn't remove cached items. https://github.com/Vanilla-Expanded/VanillaExpandedFramework/blob/f7abe05737e4f216ad14198ce6c5489b784f1e1b/Source/VFECore/VFECore/Comps/ThingComps/CompMachineChargingStation.cs#L24-L25cachedChargingStations
allows duplication.cachedChargingStationsDict
recognize samething
in different states as different keys. I think makingcachedChargingStationsDict
aDictionary<ThingID, CompMachineChargingStation>
will prevent this issue, but cached items still get kept between saves.