Functionality of objects in lists

Didn’t think I’d hit another impasse this soon, but here we are. This time my question involves having lists of objects. Specifically, lists of objects that are ment to be like states. Think buffs and rebuffs like poison. I was originally using actor state and curState, but because of their specific uses, I decided to go my own route. During this move to a different system, one of my functionalities broke. Particularly this piece of code which is meant to constrain the player to only interacting with the object causing the inhibition.

    restrainingObject = nil
    /*using this method*/
        restrainingObject = newObject;
    checkMoveViaPath(obj, dest, op)
         *   determines if an item is in reach (i.e. only the restraining
         *   object) and restricts movement.
        if (dest != restrainingObject)
            return new CheckStatusFailure(
                'You cannot do that right now; 
                you are restrained by <<isRestrained.restrainingObject.theName()>>.');
        else return checkStatusSuccess;
        if (gDobj != restrainingObject && gActionIs(Examine)){

I’m not really sure how to fix it. I understand this code must have worked only because of the functionality of curState, but I’m not sure what that functionality is, why it’s used, and how to restore it. Could I get some help on this? note: my states still use the ActorState class if that helps any.