mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-05 03:19:23 +00:00
Offset in VR fix
Fix of illogical bug of null player descriptor
This commit is contained in:
parent
84b0de7065
commit
171f129039
2 changed files with 41 additions and 35 deletions
|
@ -41,25 +41,28 @@ namespace ml_pin
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
bool l_isFriend = Friends.FriendsWith(p_player.ownerId);
|
if(p_player != null) // This happens sometimes, no idea why
|
||||||
bool l_notify = false;
|
|
||||||
|
|
||||||
switch(Settings.NotifyType)
|
|
||||||
{
|
{
|
||||||
case Settings.NotificationType.None:
|
bool l_isFriend = Friends.FriendsWith(p_player.ownerId);
|
||||||
l_notify = false;
|
bool l_notify = false;
|
||||||
break;
|
|
||||||
case Settings.NotificationType.Friends:
|
|
||||||
l_notify = (l_isFriend && ShouldNotifyInCurrentInstance());
|
|
||||||
break;
|
|
||||||
case Settings.NotificationType.All:
|
|
||||||
l_notify = ShouldNotifyInCurrentInstance();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
l_notify |= (l_isFriend && Settings.FriendsAlways);
|
|
||||||
|
|
||||||
if(l_notify)
|
switch(Settings.NotifyType)
|
||||||
m_soundManager?.PlaySound(l_isFriend ? SoundManager.SoundType.FriendJoin : SoundManager.SoundType.PlayerJoin);
|
{
|
||||||
|
case Settings.NotificationType.None:
|
||||||
|
l_notify = false;
|
||||||
|
break;
|
||||||
|
case Settings.NotificationType.Friends:
|
||||||
|
l_notify = (l_isFriend && ShouldNotifyInCurrentInstance());
|
||||||
|
break;
|
||||||
|
case Settings.NotificationType.All:
|
||||||
|
l_notify = ShouldNotifyInCurrentInstance();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
l_notify |= (l_isFriend && Settings.FriendsAlways);
|
||||||
|
|
||||||
|
if(l_notify)
|
||||||
|
m_soundManager?.PlaySound(l_isFriend ? SoundManager.SoundType.FriendJoin : SoundManager.SoundType.PlayerJoin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
|
@ -70,25 +73,28 @@ namespace ml_pin
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
bool l_isFriend = Friends.FriendsWith(p_player.ownerId);
|
if(p_player != null) // This happens sometimes, no idea why
|
||||||
bool l_notify = false;
|
|
||||||
|
|
||||||
switch(Settings.NotifyType)
|
|
||||||
{
|
{
|
||||||
case Settings.NotificationType.None:
|
bool l_isFriend = Friends.FriendsWith(p_player.ownerId);
|
||||||
l_notify = false;
|
bool l_notify = false;
|
||||||
break;
|
|
||||||
case Settings.NotificationType.Friends:
|
|
||||||
l_notify = (l_isFriend && ShouldNotifyInCurrentInstance());
|
|
||||||
break;
|
|
||||||
case Settings.NotificationType.All:
|
|
||||||
l_notify = ShouldNotifyInCurrentInstance();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
l_notify |= (l_isFriend && Settings.FriendsAlways);
|
|
||||||
|
|
||||||
if(l_notify)
|
switch(Settings.NotifyType)
|
||||||
m_soundManager?.PlaySound(l_isFriend ? SoundManager.SoundType.FriendLeave : SoundManager.SoundType.PlayerLeave);
|
{
|
||||||
|
case Settings.NotificationType.None:
|
||||||
|
l_notify = false;
|
||||||
|
break;
|
||||||
|
case Settings.NotificationType.Friends:
|
||||||
|
l_notify = (l_isFriend && ShouldNotifyInCurrentInstance());
|
||||||
|
break;
|
||||||
|
case Settings.NotificationType.All:
|
||||||
|
l_notify = ShouldNotifyInCurrentInstance();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
l_notify |= (l_isFriend && Settings.FriendsAlways);
|
||||||
|
|
||||||
|
if(l_notify)
|
||||||
|
m_soundManager?.PlaySound(l_isFriend ? SoundManager.SoundType.FriendLeave : SoundManager.SoundType.PlayerLeave);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -763,7 +763,7 @@ namespace ml_prm
|
||||||
|
|
||||||
internal bool ShoudlDisableHeadOffset()
|
internal bool ShoudlDisableHeadOffset()
|
||||||
{
|
{
|
||||||
return (!m_inVR && m_enabled && (m_vrIK != null));
|
return (m_enabled && (m_vrIK != null));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void TryRestoreMovement()
|
static void TryRestoreMovement()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue