simplyWiri / Loadout-Compositing

GNU Lesser General Public License v3.0
12 stars 8 forks source link

Feature/Bug: VFE:Pirate Warcasket missing Loadout ability #72

Closed PapaTim68 closed 1 year ago

PapaTim68 commented 1 year ago

Is there a specific reason why the ability to use loadouts disappears after getting a pawn into a VFE:Pirate Warcasket? Is there any possibility to re-enable the ability to use it? While the Warcasket parts are not removable, so much more stuff can be done with Loadouts...

simplyWiri commented 1 year ago

Unfortunately, this may be not a simple one to solve, we decide who can have a loadout with this function:

        public static bool IsValidLoadoutHolder(this Pawn pawn) {
            return pawn.RaceProps.Humanlike
                   && !pawn.RaceProps.Animal
                   && pawn.IsColonist
                   && !pawn.Dead
                   && !pawn.IsQuestLodger()
                   && !(pawn.apparel?.AnyApparelLocked ?? true)
                   && !pawn.RaceProps.packAnimal; // for a mod which has animals which somehow pass all of the above criteria...
        }

I believe the case that is failing is pawn.apparel?.AnyApparelLocked. This means, if any apparel from the pawn is locked (i.e. can not be removed by the player) - the pawn cannot be a loadout holder.

This is because the games definition of what a Colonist is stretched by things like quests and guests - we do not want to give either of those two aforementioned pawn kinds loadouts, and the only way I know of doing this - is by checking if the apparel is locked or not.

Sorry!