gruppe-adler / grad-persistence

Save/Load mission progress in server's profileNamespace
26 stars 13 forks source link

Object inventories not properly saved with ACRE #57

Open MrFleff opened 1 year ago

MrFleff commented 1 year ago

Problem: Any vehicle or ammo box will not save items properly

Solution: I dug around and found that the function 'deinstanceACRERadios' isn't defined in the functions.hpp. After defining it here the issue was gone.

maxcloutier13 commented 1 year ago

Could you provide some more details on your fix? What "functions.hpp" file?

MrFleff commented 1 year ago

Could you provide some more details on your fix? What "functions.hpp" file?

Sure, let me try to explain.

Included in the grad persist script is the cfgfunctions.hpp where all functions used in the code are defined. In that file scrolling to the last section where 'class save' is you'll find the first function is to 'deinstanceTFARradios'. This is done to ensure duplicates of radios don't exist on multiple players; however, what's missing here is the same for users that use ACRE2. Later in the save vehicle equipment section it calls for a deinstanceacre2 if the mod is enabled but because the function was mistakenly undefined no items will end up saved at all.

To fix this, almost identical to the defining of the tfar function below, all you have to do is define a function for 'deinstanceACRERadios'

Hope this helps!

maxcloutier13 commented 1 year ago

Amazingly fast answer! Thanks a lot.