Ignoring local player's pointers option

Settings hide
This commit is contained in:
SDraw 2023-04-15 13:51:12 +03:00
parent fa5a0334b9
commit f983f2909c
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
3 changed files with 28 additions and 2 deletions

View file

@ -1,4 +1,5 @@
using ABI.CCK.Components;
using ABI_RC.Core.Player;
using UnityEngine;
namespace ml_prm
@ -32,7 +33,7 @@ namespace ml_prm
void OnTriggerEnter(Collider p_other)
{
CVRPointer l_pointer = p_other.GetComponent<CVRPointer>();
if((l_pointer != null) && (l_pointer.type == "ragdoll") && (m_lastTrigger != p_other))
if((l_pointer != null) && (l_pointer.type == "ragdoll") && !IsIgnored(l_pointer.transform) && (m_lastTrigger != p_other))
{
m_lastTrigger = p_other;
m_triggered = true;
@ -51,5 +52,10 @@ namespace ml_prm
m_triggered = false;
return l_state;
}
static bool IsIgnored(Transform p_transform)
{
return (Settings.IgnoreLocal && (p_transform.root == PlayerSetup.Instance.transform));
}
}
}