예제 #1
0
        public void SetSitting(bool sit, UUID target)
        {
            sitting = sit;

            if (sitting)
            {
                Client.Self.RequestSit(target, Vector3.Zero);
                Client.Self.Sit();
            }
            else
            {
                if (!instance.RLV.RestictionActive("unsit"))
                {
                    Client.Self.Stand();
                }
                else
                {
                    instance.TabConsole.DisplayNotificationInChat("Unsit prevented by RLV");
                    sitting = true;
                    return;
                }
            }

            SitStateChanged?.Invoke(this, new SitEventArgs(sitting));

            if (!sitting)
            {
                StopAllAnimations();
            }
        }
예제 #2
0
        void Objects_AvatarSitChanged(object sender, AvatarSitChangedEventArgs e)
        {
            if (e.Avatar.LocalID != Client.Self.LocalID)
            {
                return;
            }

            sitting = e.SittingOn != 0;

            if (Client.Self.SittingOn != 0 && !Client.Network.CurrentSim.ObjectsPrimitives.ContainsKey(Client.Self.SittingOn))
            {
                Client.Objects.RequestObject(Client.Network.CurrentSim, Client.Self.SittingOn);
            }

            SitStateChanged?.Invoke(this, new SitEventArgs(sitting));
        }