CP-Dev-Team / CannabisPlus

Other
2 stars 1 forks source link

Possible variable name conflict 'j' and 'p' #106

Open kotori opened 5 days ago

kotori commented 5 days ago

(W): @"CannabisPlus/scripts/4_World/entities\itembase\drypost.c,502": Possible variable name conflict 'p' (W): @"CannabisPlus/scripts/4_World/entities\itembase\drypost.c,512": Possible variable name conflict 'j'

This looks easy enough to neutralize by using absolutely any other variable names besides the two chosen as they are defined elsewhere, since they are defined locally it won't hurt to just do this w/o the conflict.

Possible Solution, use 'ps' for 'p' and 'js' for 'j'

Line 496

    void LockDryingSlots(bool do_lock)
    {
        ItemBase item;

        if (do_lock)
        {
            for (int ps = 0; ps < plant_slots.Count(); ps++)
            {
                if (Class.CastTo(item, GetInventory().FindAttachment(plant_slots.Get(ps) )))
                {
                      item.LockToParent();  // ToDo: Need to lock ALL slots by SlotID, not just occupied slots.  See Issue#20
                }
            }
        }
        else
        {
            for (int js = 0; js < plant_slots.Count(); js++)
            {
                if (Class.CastTo(item, GetInventory().FindAttachment(plant_slots.Get(js) )))
                {
                      item.UnlockFromParent(); // ToDo: I don't think this is the right function.  >> Ice: I agree.  Can't UnlockFromParent since the RawCannabisPlant is deleted and thus you can't have a "Parent" of nothing.  Need to unlock by slotID.
                }
            }
        }
    };