Exemple #1
0
        public bool ReleaseProp(bool dispatchPlacementEffect)
        {
            CheckPropStillExists();

            if (stillExists == false)
            {
                return(false);
            }
            else
            {
                if (Singleton <PropManager> .instance.m_props.m_buffer[(int)((UIntPtr)propPlacementInfo.propID)].m_flags != 0)
                {
                    PropManager instance = Singleton <PropManager> .instance;
                    instance.ReleaseProp(propPlacementInfo.propID);
                    if (dispatchPlacementEffect)
                    {
                        PropLineTool.DispatchPlacementEffect(propPlacementInfo.position, true);
                    }

                    return(true);
                }

                return(false);
            }
        }
        private static void ClearDecorations()
        {
            NetManager netManager = Singleton <NetManager> .instance;

            for (int i = 1; i < Mod.MAX_NET_SEGMENTS; i++)
            {
                if (netManager.m_segments.m_buffer[i].m_flags != NetSegment.Flags.None)
                {
                    netManager.ReleaseSegment((ushort)i, true);
                }
            }
            for (int j = 1; j < Mod.MAX_NET_NODES; j++)
            {
                if (netManager.m_nodes.m_buffer[j].m_flags != NetNode.Flags.None)
                {
                    netManager.ReleaseNode((ushort)j);
                }
            }
            PropManager propManager = Singleton <PropManager> .instance;

            for (int k = 1; k < 65536; k++)
            {
                if (propManager.m_props.m_buffer[k].m_flags != 0)
                {
                    propManager.ReleaseProp((ushort)k);
                }
            }
            TreeManager treeManager = Singleton <TreeManager> .instance;

            for (int l = 1; l < LimitTreeManager.Helper.TreeLimit; l++)
            {
                if (treeManager.m_trees.m_buffer[l].m_flags != 0)
                {
                    treeManager.ReleaseTree((uint)l);
                }
            }
        }