Пример #1
0
        private bool onForceLeave(IglooServiceEvents.ForceLeave evt)
        {
            HeldObjectsData component = dataEntityCollection.GetComponent <HeldObjectsData>(dataEntityCollection.LocalPlayerHandle);

            if (component.HeldObject.ObjectType == HeldObjectType.PARTYGAME)
            {
                component.HeldObject = null;
            }
            return(false);
        }
Пример #2
0
        private bool onHeldObjectDequipped(PlayerStateServiceEvents.HeldObjectDequipped evt)
        {
            DataEntityHandle dataEntityHandle = dataEntityCollection.FindEntity <SessionIdData, long>(evt.SessionId);

            if (!dataEntityHandle.IsNull && dataEntityCollection.HasComponent <HeldObjectsData>(dataEntityHandle))
            {
                HeldObjectsData component = dataEntityCollection.GetComponent <HeldObjectsData>(dataEntityHandle);
                if (!isLocalPlayer(evt.SessionId) || (component.HeldObject != null && component.HeldObject.ObjectType == HeldObjectType.PARTYGAME))
                {
                    dataEntityCollection.GetComponent <HeldObjectsData>(dataEntityHandle).HeldObject = null;
                }
            }
            return(false);
        }