示例#1
0
        // Function from file: cameranet.dm
        public void majorChunkChange(Ent_Static c = null, int choice = 0)
        {
            dynamic     T     = null;
            int         x1    = 0;
            int         y1    = 0;
            int?        x2    = null;
            int?        y2    = null;
            int?        x     = null;
            int?        y     = null;
            Camerachunk chunk = null;


            if (!(c != null))
            {
                return;
            }
            T = GlobalFuncs.get_turf(c);

            if (Lang13.Bool(T))
            {
                x1 = Num13.MaxInt(0, Convert.ToInt32(T.x - 8)) & 65520;
                y1 = Num13.MaxInt(0, Convert.ToInt32(T.y - 8)) & 65520;
                x2 = Num13.MinInt(Game13.map_size_x, Convert.ToInt32(T.x + 8)) & 65520;
                y2 = Num13.MinInt(Game13.map_size_y, Convert.ToInt32(T.y + 8)) & 65520;
                x  = null;
                x  = x1;

                while ((x ?? 0) <= (x2 ?? 0))
                {
                    y = null;
                    y = y1;

                    while ((y ?? 0) <= (y2 ?? 0))
                    {
                        if (Lang13.Bool(this.chunkGenerated(x, y, Convert.ToInt32(T.z))))
                        {
                            chunk = this.getCameraChunk(x, y, Convert.ToInt32(T.z));

                            if (choice == 0)
                            {
                                chunk.cameras.Remove(c);
                            }
                            else if (choice == 1)
                            {
                                chunk.cameras.Or(c);
                            }
                            chunk.hasChanged();
                        }
                        y += GlobalVars.CHUNK_SIZE;
                    }
                    x += GlobalVars.CHUNK_SIZE;
                }
            }
            return;
        }
示例#2
0
        // Function from file: cameranet.dm
        public void updateChunk(int?x = null, int?y = null, int z = 0)
        {
            Camerachunk chunk = null;


            if (!Lang13.Bool(this.chunkGenerated(x, y, z)))
            {
                return;
            }
            chunk = this.getCameraChunk(x, y, z);
            chunk.hasChanged();
            return;
        }
示例#3
0
        // Function from file: cameranet.dm
        public bool checkTurfVis(dynamic position = null)
        {
            Camerachunk chunk = null;

            chunk = this.getCameraChunk(Lang13.IntNullable(position.x), Lang13.IntNullable(position.y), Convert.ToInt32(position.z));

            if (chunk != null)
            {
                if (chunk.changed)
                {
                    chunk.hasChanged(true);
                }

                if (Lang13.Bool(chunk.visibleTurfs[position]))
                {
                    return(true);
                }
            }
            return(false);
        }