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(); } }
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)); }