Example #1
0
        public override bool SharedCanInteract(ICharacter character, IStaticWorldObject worldObject, bool writeToLog)
        {
            if (!base.SharedCanInteract(character, worldObject, writeToLog))
            {
                return(false);
            }

            if (LandClaimSystem.SharedIsObjectInsideOwnedOrFreeArea(worldObject, character) ||
                CreativeModeSystem.SharedIsInCreativeMode(character))
            {
                return(true);
            }

            // not the land owner
            if (writeToLog)
            {
                Logger.Warning(
                    $"Character cannot interact with {worldObject} - not the land owner.",
                    character);

                if (IsServer)
                {
                    LandClaimSystem.ServerNotifyCannotInteractNotOwner(character, worldObject);
                }
            }

            return(false);
        }
Example #2
0
        public override bool SharedCanInteract(ICharacter character, IStaticWorldObject worldObject, bool writeToLog)
        {
            if (!base.SharedCanInteract(character, worldObject, writeToLog))
            {
                return(false);
            }

            if (CreativeModeSystem.SharedIsInCreativeMode(character))
            {
                return(true);
            }

            if (LandClaimSystem.SharedIsObjectInsideOwnedOrFreeArea(worldObject,
                                                                    character,
                                                                    requireFactionPermission: true))
            {
                return(true);
            }

            if (writeToLog)
            {
                if (IsServer)
                {
                    LandClaimSystem.ServerNotifyCannotInteractNotOwner(character, worldObject);
                }
                else
                {
                    LandClaimSystem.ClientCannotInteractNotOwner(worldObject);
                }
            }

            return(false);
        }