How to return default behavior?Solved

Hi, how can I make this function return her default behavior?

private bool CanUseLockedEntity(BasePlayer playerBaseLock baselock)
        {

            if (baselock.ShortPrefabName == "lock.code")
            {
                CodeLock codelock = (CodeLock)baselock;

                if (codelock.whitelistPlayers.Contains(player.userID))
                    return true
                else
                    return false;
            }

           RETURN DEFAULT BEHAVIOR HERE <-----------------------------------------
        }
private object CanUseLockedEntity(BasePlayer player, CodeLock codeLock)
{
    if (!codeLock.whitelistPlayers.Contains(player.userID))
        return false;

    return null;
}

The above allows you to avoid unnecessary hook calls, casting, and returning.

here is what I get if I try to return null:

Error while compiling: Plugin.cs(70,20): error CS0037: Cannot convert null to `bool' because it is a value type



Merged post

Oh my fault, I didn't know I could "edit" the hook:

from: private bool CanUseLockedEntity, to: private object CanUseLockedEntity

You could either follow Wulf's example or use the nullable bool type "bool?"

Locked automatically