jasonrohrer / OneLife

a multiplayer survival game of parenting and civilization building
http://onehouronelife.com
Other
1.01k stars 282 forks source link

Mods not removed from import_add after importing #1079

Closed DopiePanda closed 4 months ago

DopiePanda commented 4 months ago

When importing mods, the mods imported gets copied into the "imported" folder, but does not get removed from the import_add folder, so you need to remember to manually remove it from this as well as the import_replace folders, if not if will keep creating new duplicate objects everytime you lauch the editor untill the OXZ file(s) are removed.

I suggest it gets automatically removed either at the end of importing, or when closing out of the editor cause this is easy to forget and causes extra confusion and a lot of extra work if there is multiple mods or mods with many objects you are importing.

jasonrohrer commented 4 months ago

This is surprising... I've tested this a bunch... I'm guessing there's a bug here, maybe on Windows only. Looking into it.

jasonrohrer commented 4 months ago

Yeah, on Linux this is definitely working correctly...

jasonrohrer commented 4 months ago

NewColoritems_104_16521c.oxz.zip

Adding a sample import file to test with.

jasonrohrer commented 4 months ago

Indeed! Removing the imported stuff isn't working on Windows. Sorry about that!

jasonrohrer commented 4 months ago

This line isn't working on Windows:

https://github.com/jasonrohrer/minorGems/blob/aeaa3543bb856c90dea53ed54fe19d12a2e781a5/io/file/File.h#L877

jasonrohrer commented 4 months ago

Actually, the problem seems to be that elsewhere in the importer code, there are fopen calls without corresponding calls to fclose. Windows won't let a file get removed that is still open somewhere.