Destroyed pickup detection

Matching versions with stable build
This commit is contained in:
SDraw 2023-03-19 14:12:01 +03:00
parent 7acc7636f2
commit c0bff73107
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
5 changed files with 12 additions and 7 deletions

View file

@ -61,10 +61,15 @@ namespace ml_pam
void Update()
{
if(m_enabled && (m_pickup != null))
if(m_enabled && !ReferenceEquals(m_pickup, null))
{
Matrix4x4 l_result = m_pickup.transform.GetMatrix() * m_offset;
m_target.position = l_result * ms_pointVector;
if(m_pickup != null)
{
Matrix4x4 l_result = m_pickup.transform.GetMatrix() * m_offset;
m_target.position = l_result * ms_pointVector;
}
else
this.OnPickupDrop(m_pickup);
}
}