acemod / ACE3

Open-source realism mod for Arma 3
https://ace3.acemod.org
Other
1k stars 736 forks source link

Arsenal - Reuse current inventory containers when importing invalid loadouts #10364

Open mrschick opened 3 weeks ago

mrschick commented 3 weeks ago

When merged this pull request will:

The use case for this change is missions in which the arsenal is restricted to clothing from a specific faction, but still contains all the usual medical and other specialized equipment for a given role. Previously, even if one had saved a very similar loadout, but with a different camo, it was impossible to load it without losing all clothing items. Forcing one to redo the entire loadout from scratch. With this change, it will be possible to import such a loadout, so that the numerous equipment items will be placed in already worn clothing of the specific faction, saving time.

If "" is given as a container, an error is thrown, therefore, filter out all unavailable/null containers

I realize that this was part of optimization work in #9316. Since it hinders this implementation, I removed that check. I have not found it causing errors when importing loadouts.

LinkIsGrim commented 2 weeks ago

I realize that this was part of optimization work in https://github.com/acemod/ACE3/pull/9316.

I think loadout validation is spread out over multiple frames now so it doesn't matter as much

Just for confirmation's sake: does this only apply if the class doesn't exist, or also for items that aren't available in the arsenal as well?

Not the problem if the latter, it opens up an interesting possibility (layered loadouts)

mrschick commented 2 weeks ago

does this only apply if the class doesn't exist, or also for items that aren't available in the arsenal as well?

It applies whenever fnc_verifyLoadout.sqf returns an inventory container's config name as "", which happens in both cases.