I am trying to prevent immune players from changing existing codes by returning a non-null value, but it seems there is a bug if we're setting the code for the first time, or am I missing something?
https://streamable.com/pgfpqx
https://streamable.com/pgfpqx
private object CanChangeCode(BasePlayer player, CodeLock codeLock, string newCode)
{
if (immune.Contains(player))
{
player.ChatMessage("<color=red>You cannot change codes while you are immune!</color>");
player.ChatMessage($"(DEBUG) New code: {newCode}");
return false;
}
return null;
}