public void method282(int i, Animable class30_sub2_sub4, int j, int k, sbyte byte0, int l,
							  Animable class30_sub2_sub4_1, int i1, int j1, int k1)
        {
            if (class30_sub2_sub4 == null && class30_sub2_sub4_1 == null)
                return;
            Object1 object1 = new Object1();
            object1.uid = j;
            object1.aByte281 = byte0;
            object1.anInt274 = l * 128 + 64;
            object1.anInt275 = k * 128 + 64;
            object1.anInt273 = i1;
            object1.aClass30_Sub2_Sub4_278 = class30_sub2_sub4;
            object1.aClass30_Sub2_Sub4_279 = class30_sub2_sub4_1;
            object1.orientation = i;
            object1.orientation1 = j1;
            for (int l1 = k1; l1 >= 0; l1--)
                if (groundArray[l1][l][k] == null)
                    groundArray[l1][l][k] = new Ground(l1, l, k);

            groundArray[k1][l][k].obj1 = object1;
        }
        public void method283(int i, int j, int k, int i1, int j1, int k1,
							  Animable class30_sub2_sub4, int l1, sbyte byte0, int i2, int j2)
        {
            if (class30_sub2_sub4 == null)
                return;
            Object2 class26 = new Object2();
            class26.uid = i;
            class26.aByte506 = byte0;
            class26.anInt500 = l1 * 128 + 64 + j1;
            class26.anInt501 = j * 128 + 64 + i2;
            class26.anInt499 = k1;
            class26.aClass30_Sub2_Sub4_504 = class30_sub2_sub4;
            class26.anInt502 = j2;
            class26.anInt503 = k;
            for (int k2 = i1; k2 >= 0; k2--)
                if (groundArray[k2][l1][j] == null)
                    groundArray[k2][l1][j] = new Ground(k2, l1, j);

            groundArray[i1][l1][j].obj2 = class26;
        }
        public void method280(int i, int j, int k, Animable class30_sub2_sub4, sbyte byte0, int i1,
							  int j1)
        {
            if (class30_sub2_sub4 == null)
                return;
            Object3 class49 = new Object3();
            class49.aClass30_Sub2_Sub4_814 = class30_sub2_sub4;
            class49.anInt812 = j1 * 128 + 64;
            class49.anInt813 = k * 128 + 64;
            class49.anInt811 = j;
            class49.uid = i1;
            class49.aByte816 = byte0;
            if (groundArray[i][j1][k] == null)
                groundArray[i][j1][k] = new Ground(i, j1, k);
            groundArray[i][j1][k].obj3 = class49;
        }
        public void method281(int i, int j, Animable class30_sub2_sub4, int k, Animable class30_sub2_sub4_1, Animable class30_sub2_sub4_2,
							  int l, int i1)
        {
            Object4 object4 = new Object4();
            object4.aClass30_Sub2_Sub4_48 = class30_sub2_sub4_2;
            object4.anInt46 = i * 128 + 64;
            object4.anInt47 = i1 * 128 + 64;
            object4.anInt45 = k;
            object4.uid = j;
            object4.aClass30_Sub2_Sub4_49 = class30_sub2_sub4;
            object4.aClass30_Sub2_Sub4_50 = class30_sub2_sub4_1;
            int j1 = 0;
            Ground class30_sub3 = groundArray[l][i][i1];
            if (class30_sub3 != null)
            {
                for (int k1 = 0; k1 < class30_sub3.anInt1317; k1++)
                    if (class30_sub3.obj5Array[k1].aClass30_Sub2_Sub4_521 is Model)
                    {
                        int l1 = ((Model)class30_sub3.obj5Array[k1].aClass30_Sub2_Sub4_521).anInt1654;
                        if (l1 > j1)
                            j1 = l1;
                    }

            }
            object4.anInt52 = j1;
            if (groundArray[l][i][i1] == null)
                groundArray[l][i][i1] = new Ground(l, i, i1);
            groundArray[l][i][i1].obj4 = object4;
        }
        public void method279(int i, int j, int k, int l, int i1, int j1, int k1,
				int l1, int i2, int j2, int k2, int l2, int i3, int j3,
				int k3, int l3, int i4, int j4, int k4, int l4)
        {
            if (l == 0)
            {
                Class43 class43 = new Class43(k2, l2, i3, j3, -1, k4, false);
                for (int i5 = i; i5 >= 0; i5--)
                    if (groundArray[i5][j][k] == null)
                        groundArray[i5][j][k] = new Ground(i5, j, k);

                groundArray[i][j][k].aClass43_1311 = class43;
                return;
            }
            if (l == 1)
            {
                Class43 class43_1 = new Class43(k3, l3, i4, j4, j1, l4, k1 == l1 && k1 == i2 && k1 == j2);
                for (int j5 = i; j5 >= 0; j5--)
                    if (groundArray[j5][j][k] == null)
                        groundArray[j5][j][k] = new Ground(j5, j, k);

                groundArray[i][j][k].aClass43_1311 = class43_1;
                return;
            }
            Class40 class40 = new Class40(k, k3, j3, i2, j1, i4, i1, k2, k4, i3, j2, l1, k1, l, j4, l3, l2, j, l4);
            for (int k5 = i; k5 >= 0; k5--)
                if (groundArray[k5][j][k] == null)
                    groundArray[k5][j][k] = new Ground(k5, j, k);

            groundArray[i][j][k].aClass40_1312 = class40;
        }
        public void method276(int i, int j)
        {
            Ground class30_sub3 = groundArray[0][j][i];
            for (int l = 0; l < 3; l++)
            {
                Ground class30_sub3_1 = groundArray[l][j][i] = groundArray[l + 1][j][i];
                if (class30_sub3_1 != null)
                {
                    class30_sub3_1.anInt1307--;
                    for (int j1 = 0; j1 < class30_sub3_1.anInt1317; j1++)
                    {
                        Object5 class28 = class30_sub3_1.obj5Array[j1];
                        if ((class28.uid >> 29 & 3) == 2 && class28.anInt523 == j && class28.anInt525 == i)
                            class28.anInt517--;
                    }

                }
            }
            if (groundArray[0][j][i] == null)
                groundArray[0][j][i] = new Ground(0, j, i);
            groundArray[0][j][i].aClass30_Sub3_1329 = class30_sub3;
            groundArray[3][j][i] = null;
        }
        public void method275(int i)
        {
            anInt442 = i;
            for (int k = 0; k < anInt438; k++)
            {
                for (int l = 0; l < anInt439; l++)
                    if (groundArray[i][k][l] == null)
                        groundArray[i][k][l] = new Ground(i, k, l);

            }
        }
        private void method314(Ground class30_sub3, bool flag)
        {
            aClass19_477.Push(class30_sub3);
            do
            {
                Ground class30_sub3_1;
                do
                {
                    if (aClass19_477.Count == 0)
                        return;
                    class30_sub3_1 = (Ground)aClass19_477.Pop();
                    if (class30_sub3_1 == null)
                        return;
                } while (!class30_sub3_1.aBoolean1323);
                int i = class30_sub3_1.anInt1308;
                int j = class30_sub3_1.anInt1309;
                int k = class30_sub3_1.anInt1307;
                int l = class30_sub3_1.anInt1310;
                Ground[][] aclass30_sub3 = groundArray[k];
                if (class30_sub3_1.aBoolean1322)
                {
                    if (flag)
                    {
                        if (k > 0)
                        {
                            Ground class30_sub3_2 = groundArray[k - 1][i][j];
                            if (class30_sub3_2 != null && class30_sub3_2.aBoolean1323)
                                continue;
                        }
                        if (i <= anInt453 && i > anInt449)
                        {
                            Ground class30_sub3_3 = aclass30_sub3[i - 1][j];
                            if (class30_sub3_3 != null && class30_sub3_3.aBoolean1323 && (class30_sub3_3.aBoolean1322 || (class30_sub3_1.anInt1320 & 1) == 0))
                                continue;
                        }
                        if (i >= anInt453 && i < anInt450 - 1)
                        {
                            Ground class30_sub3_4 = aclass30_sub3[i + 1][j];
                            if (class30_sub3_4 != null && class30_sub3_4.aBoolean1323 && (class30_sub3_4.aBoolean1322 || (class30_sub3_1.anInt1320 & 4) == 0))
                                continue;
                        }
                        if (j <= anInt454 && j > anInt451)
                        {
                            Ground class30_sub3_5 = aclass30_sub3[i][j - 1];
                            if (class30_sub3_5 != null && class30_sub3_5.aBoolean1323 && (class30_sub3_5.aBoolean1322 || (class30_sub3_1.anInt1320 & 8) == 0))
                                continue;
                        }
                        if (j >= anInt454 && j < anInt452 - 1)
                        {
                            Ground class30_sub3_6 = aclass30_sub3[i][j + 1];
                            if (class30_sub3_6 != null && class30_sub3_6.aBoolean1323 && (class30_sub3_6.aBoolean1322 || (class30_sub3_1.anInt1320 & 2) == 0))
                                continue;
                        }
                    }
                    else
                    {
                        flag = true;
                    }
                    class30_sub3_1.aBoolean1322 = false;
                    if (class30_sub3_1.aClass30_Sub3_1329 != null)
                    {
                        Ground class30_sub3_7 = class30_sub3_1.aClass30_Sub3_1329;
                        if (class30_sub3_7.aClass43_1311 != null)
                        {
                            if (!method320(0, i, j))
                                method315(class30_sub3_7.aClass43_1311, 0, anInt458, anInt459, anInt460, anInt461, i, j);
                        }
                        else
                            if (class30_sub3_7.aClass40_1312 != null && !method320(0, i, j))
                                method316(i, anInt458, anInt460, class30_sub3_7.aClass40_1312, anInt459, j, anInt461);
                        Object1 class10 = class30_sub3_7.obj1;
                        if (class10 != null)
                            class10.aClass30_Sub2_Sub4_278.Render(0, anInt458, anInt459, anInt460, anInt461, class10.anInt274 - anInt455, class10.anInt273 - anInt456, class10.anInt275 - anInt457, class10.uid);
                        for (int i2 = 0; i2 < class30_sub3_7.anInt1317; i2++)
                        {
                            Object5 class28 = class30_sub3_7.obj5Array[i2];
                            if (class28 != null)
                                class28.aClass30_Sub2_Sub4_521.Render(class28.anInt522, anInt458, anInt459, anInt460, anInt461, class28.anInt519 - anInt455, class28.anInt518 - anInt456, class28.anInt520 - anInt457, class28.uid);
                        }

                    }
                    bool flag1 = false;
                    if (class30_sub3_1.aClass43_1311 != null)
                    {
                        if (!method320(l, i, j))
                        {
                            flag1 = true;
                            method315(class30_sub3_1.aClass43_1311, l, anInt458, anInt459, anInt460, anInt461, i, j);
                        }
                    }
                    else
                        if (class30_sub3_1.aClass40_1312 != null && !method320(l, i, j))
                        {
                            flag1 = true;
                            method316(i, anInt458, anInt460, class30_sub3_1.aClass40_1312, anInt459, j, anInt461);
                        }
                    int j1 = 0;
                    int j2 = 0;
                    Object1 class10_3 = class30_sub3_1.obj1;
                    Object2 class26_1 = class30_sub3_1.obj2;
                    if (class10_3 != null || class26_1 != null)
                    {
                        if (anInt453 == i)
                            j1++;
                        else
                            if (anInt453 < i)
                                j1 += 2;
                        if (anInt454 == j)
                            j1 += 3;
                        else
                            if (anInt454 > j)
                                j1 += 6;
                        j2 = anIntArray478[j1];
                        class30_sub3_1.anInt1328 = anIntArray480[j1];
                    }
                    if (class10_3 != null)
                    {
                        if ((class10_3.orientation & anIntArray479[j1]) != 0)
                        {
                            if (class10_3.orientation == 16)
                            {
                                class30_sub3_1.anInt1325 = 3;
                                class30_sub3_1.anInt1326 = anIntArray481[j1];
                                class30_sub3_1.anInt1327 = 3 - class30_sub3_1.anInt1326;
                            }
                            else
                                if (class10_3.orientation == 32)
                                {
                                    class30_sub3_1.anInt1325 = 6;
                                    class30_sub3_1.anInt1326 = anIntArray482[j1];
                                    class30_sub3_1.anInt1327 = 6 - class30_sub3_1.anInt1326;
                                }
                                else
                                    if (class10_3.orientation == 64)
                                    {
                                        class30_sub3_1.anInt1325 = 12;
                                        class30_sub3_1.anInt1326 = anIntArray483[j1];
                                        class30_sub3_1.anInt1327 = 12 - class30_sub3_1.anInt1326;
                                    }
                                    else
                                    {
                                        class30_sub3_1.anInt1325 = 9;
                                        class30_sub3_1.anInt1326 = anIntArray484[j1];
                                        class30_sub3_1.anInt1327 = 9 - class30_sub3_1.anInt1326;
                                    }
                        }
                        else
                        {
                            class30_sub3_1.anInt1325 = 0;
                        }
                        if ((class10_3.orientation & j2) != 0 && !method321(l, i, j, class10_3.orientation))
                            class10_3.aClass30_Sub2_Sub4_278.Render(0, anInt458, anInt459, anInt460, anInt461, class10_3.anInt274 - anInt455, class10_3.anInt273 - anInt456, class10_3.anInt275 - anInt457, class10_3.uid);
                        if ((class10_3.orientation1 & j2) != 0 && !method321(l, i, j, class10_3.orientation1))
                            class10_3.aClass30_Sub2_Sub4_279.Render(0, anInt458, anInt459, anInt460, anInt461, class10_3.anInt274 - anInt455, class10_3.anInt273 - anInt456, class10_3.anInt275 - anInt457, class10_3.uid);
                    }
                    if (class26_1 != null && !method322(l, i, j, class26_1.aClass30_Sub2_Sub4_504.modelHeight))
                        if ((class26_1.anInt502 & j2) != 0)
                            class26_1.aClass30_Sub2_Sub4_504.Render(class26_1.anInt503, anInt458, anInt459, anInt460, anInt461, class26_1.anInt500 - anInt455, class26_1.anInt499 - anInt456, class26_1.anInt501 - anInt457, class26_1.uid);
                        else
                            if ((class26_1.anInt502 & 0x300) != 0)
                            {
                                int j4 = class26_1.anInt500 - anInt455;
                                int l5 = class26_1.anInt499 - anInt456;
                                int k6 = class26_1.anInt501 - anInt457;
                                int i8 = class26_1.anInt503;
                                int k9;
                                if (i8 == 1 || i8 == 2)
                                    k9 = -j4;
                                else
                                    k9 = j4;
                                int k10;
                                if (i8 == 2 || i8 == 3)
                                    k10 = -k6;
                                else
                                    k10 = k6;
                                if ((class26_1.anInt502 & 0x100) != 0 && k10 < k9)
                                {
                                    int i11 = j4 + anIntArray463[i8];
                                    int k11 = k6 + anIntArray464[i8];
                                    class26_1.aClass30_Sub2_Sub4_504.Render(i8 * 512 + 256, anInt458, anInt459, anInt460, anInt461, i11, l5, k11, class26_1.uid);
                                }
                                if ((class26_1.anInt502 & 0x200) != 0 && k10 > k9)
                                {
                                    int j11 = j4 + anIntArray465[i8];
                                    int l11 = k6 + anIntArray466[i8];
                                    class26_1.aClass30_Sub2_Sub4_504.Render(i8 * 512 + 1280 & 0x7ff, anInt458, anInt459, anInt460, anInt461, j11, l5, l11, class26_1.uid);
                                }
                            }
                    if (flag1)
                    {
                        Object3 class49 = class30_sub3_1.obj3;
                        if (class49 != null)
                            class49.aClass30_Sub2_Sub4_814.Render(0, anInt458, anInt459, anInt460, anInt461, class49.anInt812 - anInt455, class49.anInt811 - anInt456, class49.anInt813 - anInt457, class49.uid);
                        Object4 object4_1 = class30_sub3_1.obj4;
                        if (object4_1 != null && object4_1.anInt52 == 0)
                        {
                            if (object4_1.aClass30_Sub2_Sub4_49 != null)
                                object4_1.aClass30_Sub2_Sub4_49.Render(0, anInt458, anInt459, anInt460, anInt461, object4_1.anInt46 - anInt455, object4_1.anInt45 - anInt456, object4_1.anInt47 - anInt457, object4_1.uid);
                            if (object4_1.aClass30_Sub2_Sub4_50 != null)
                                object4_1.aClass30_Sub2_Sub4_50.Render(0, anInt458, anInt459, anInt460, anInt461, object4_1.anInt46 - anInt455, object4_1.anInt45 - anInt456, object4_1.anInt47 - anInt457, object4_1.uid);
                            if (object4_1.aClass30_Sub2_Sub4_48 != null)
                                object4_1.aClass30_Sub2_Sub4_48.Render(0, anInt458, anInt459, anInt460, anInt461, object4_1.anInt46 - anInt455, object4_1.anInt45 - anInt456, object4_1.anInt47 - anInt457, object4_1.uid);
                        }
                    }
                    int k4 = class30_sub3_1.anInt1320;
                    if (k4 != 0)
                    {
                        if (i < anInt453 && (k4 & 4) != 0)
                        {
                            Ground class30_sub3_17 = aclass30_sub3[i + 1][j];
                            if (class30_sub3_17 != null && class30_sub3_17.aBoolean1323)
                                aClass19_477.Push(class30_sub3_17);
                        }
                        if (j < anInt454 && (k4 & 2) != 0)
                        {
                            Ground class30_sub3_18 = aclass30_sub3[i][j + 1];
                            if (class30_sub3_18 != null && class30_sub3_18.aBoolean1323)
                                aClass19_477.Push(class30_sub3_18);
                        }
                        if (i > anInt453 && (k4 & 1) != 0)
                        {
                            Ground class30_sub3_19 = aclass30_sub3[i - 1][j];
                            if (class30_sub3_19 != null && class30_sub3_19.aBoolean1323)
                                aClass19_477.Push(class30_sub3_19);
                        }
                        if (j > anInt454 && (k4 & 8) != 0)
                        {
                            Ground class30_sub3_20 = aclass30_sub3[i][j - 1];
                            if (class30_sub3_20 != null && class30_sub3_20.aBoolean1323)
                                aClass19_477.Push(class30_sub3_20);
                        }
                    }
                }
                if (class30_sub3_1.anInt1325 != 0)
                {
                    bool flag2 = true;
                    for (int k1 = 0; k1 < class30_sub3_1.anInt1317; k1++)
                    {
                        if (class30_sub3_1.obj5Array[k1].anInt528 == anInt448 || (class30_sub3_1.anIntArray1319[k1] & class30_sub3_1.anInt1325) != class30_sub3_1.anInt1326)
                            continue;
                        flag2 = false;
                        break;
                    }

                    if (flag2)
                    {
                        Object1 class10_1 = class30_sub3_1.obj1;
                        if (!method321(l, i, j, class10_1.orientation))
                            class10_1.aClass30_Sub2_Sub4_278.Render(0, anInt458, anInt459, anInt460, anInt461, class10_1.anInt274 - anInt455, class10_1.anInt273 - anInt456, class10_1.anInt275 - anInt457, class10_1.uid);
                        class30_sub3_1.anInt1325 = 0;
                    }
                }
                if (class30_sub3_1.aBoolean1324)
                    try
                    {
                        int i1 = class30_sub3_1.anInt1317;
                        class30_sub3_1.aBoolean1324 = false;
                        int l1 = 0;
                        //label0:
                        for (int k2 = 0; k2 < i1; k2++)
                        {
                            bool doContinue = false;
                            Object5 class28_1 = class30_sub3_1.obj5Array[k2];
                            if (class28_1.anInt528 == anInt448)
                                continue;
                            for (int k3 = class28_1.anInt523; k3 <= class28_1.anInt524; k3++)
                            {
                                for (int l4 = class28_1.anInt525; l4 <= class28_1.anInt526; l4++)
                                {
                                    Ground class30_sub3_21 = aclass30_sub3[k3][l4];
                                    if (class30_sub3_21.aBoolean1322)
                                    {
                                        class30_sub3_1.aBoolean1324 = true;
                                    }
                                    else
                                    {
                                        if (class30_sub3_21.anInt1325 == 0)
                                            continue;
                                        int l6 = 0;
                                        if (k3 > class28_1.anInt523)
                                            l6++;
                                        if (k3 < class28_1.anInt524)
                                            l6 += 4;
                                        if (l4 > class28_1.anInt525)
                                            l6 += 8;
                                        if (l4 < class28_1.anInt526)
                                            l6 += 2;
                                        if ((l6 & class30_sub3_21.anInt1325) != class30_sub3_1.anInt1327)
                                            continue;
                                        class30_sub3_1.aBoolean1324 = true;
                                    }
                                    doContinue = true;
                                    break;
                                }
                                if (doContinue)
                                    break;
                            }
                            if (doContinue)
                                continue;

                            aClass28Array462[l1++] = class28_1;
                            int i5 = anInt453 - class28_1.anInt523;
                            int i6 = class28_1.anInt524 - anInt453;
                            if (i6 > i5)
                                i5 = i6;
                            int i7 = anInt454 - class28_1.anInt525;
                            int j8 = class28_1.anInt526 - anInt454;
                            if (j8 > i7)
                                class28_1.anInt527 = i5 + j8;
                            else
                                class28_1.anInt527 = i5 + i7;
                        }

                        while (l1 > 0)
                        {
                            int i3 = -50;
                            int l3 = -1;
                            for (int j5 = 0; j5 < l1; j5++)
                            {
                                Object5 class28_2 = aClass28Array462[j5];
                                if (class28_2.anInt528 != anInt448)
                                    if (class28_2.anInt527 > i3)
                                    {
                                        i3 = class28_2.anInt527;
                                        l3 = j5;
                                    }
                                    else
                                        if (class28_2.anInt527 == i3)
                                        {
                                            int j7 = class28_2.anInt519 - anInt455;
                                            int k8 = class28_2.anInt520 - anInt457;
                                            int l9 = aClass28Array462[l3].anInt519 - anInt455;
                                            int l10 = aClass28Array462[l3].anInt520 - anInt457;
                                            if (j7 * j7 + k8 * k8 > l9 * l9 + l10 * l10)
                                                l3 = j5;
                                        }
                            }

                            if (l3 == -1)
                                break;
                            Object5 class28_3 = aClass28Array462[l3];
                            class28_3.anInt528 = anInt448;
                            if (!method323(l, class28_3.anInt523, class28_3.anInt524, class28_3.anInt525, class28_3.anInt526, class28_3.aClass30_Sub2_Sub4_521.modelHeight))
                                class28_3.aClass30_Sub2_Sub4_521.Render(class28_3.anInt522, anInt458, anInt459, anInt460, anInt461, class28_3.anInt519 - anInt455, class28_3.anInt518 - anInt456, class28_3.anInt520 - anInt457, class28_3.uid);
                            for (int k7 = class28_3.anInt523; k7 <= class28_3.anInt524; k7++)
                            {
                                for (int l8 = class28_3.anInt525; l8 <= class28_3.anInt526; l8++)
                                {
                                    Ground class30_sub3_22 = aclass30_sub3[k7][l8];
                                    if (class30_sub3_22.anInt1325 != 0)
                                        aClass19_477.Push(class30_sub3_22);
                                    else
                                        if ((k7 != i || l8 != j) && class30_sub3_22.aBoolean1323)
                                            aClass19_477.Push(class30_sub3_22);
                                }

                            }

                        }
                        if (class30_sub3_1.aBoolean1324)
                            continue;
                    }
                    catch (Exception)
                    {
                        class30_sub3_1.aBoolean1324 = false;
                    }
                if (!class30_sub3_1.aBoolean1323 || class30_sub3_1.anInt1325 != 0)
                    continue;
                if (i <= anInt453 && i > anInt449)
                {
                    Ground class30_sub3_8 = aclass30_sub3[i - 1][j];
                    if (class30_sub3_8 != null && class30_sub3_8.aBoolean1323)
                        continue;
                }
                if (i >= anInt453 && i < anInt450 - 1)
                {
                    Ground class30_sub3_9 = aclass30_sub3[i + 1][j];
                    if (class30_sub3_9 != null && class30_sub3_9.aBoolean1323)
                        continue;
                }
                if (j <= anInt454 && j > anInt451)
                {
                    Ground class30_sub3_10 = aclass30_sub3[i][j - 1];
                    if (class30_sub3_10 != null && class30_sub3_10.aBoolean1323)
                        continue;
                }
                if (j >= anInt454 && j < anInt452 - 1)
                {
                    Ground class30_sub3_11 = aclass30_sub3[i][j + 1];
                    if (class30_sub3_11 != null && class30_sub3_11.aBoolean1323)
                        continue;
                }
                class30_sub3_1.aBoolean1323 = false;
                anInt446--;
                Object4 object4 = class30_sub3_1.obj4;
                if (object4 != null && object4.anInt52 != 0)
                {
                    if (object4.aClass30_Sub2_Sub4_49 != null)
                        object4.aClass30_Sub2_Sub4_49.Render(0, anInt458, anInt459, anInt460, anInt461, object4.anInt46 - anInt455, object4.anInt45 - anInt456 - object4.anInt52, object4.anInt47 - anInt457, object4.uid);
                    if (object4.aClass30_Sub2_Sub4_50 != null)
                        object4.aClass30_Sub2_Sub4_50.Render(0, anInt458, anInt459, anInt460, anInt461, object4.anInt46 - anInt455, object4.anInt45 - anInt456 - object4.anInt52, object4.anInt47 - anInt457, object4.uid);
                    if (object4.aClass30_Sub2_Sub4_48 != null)
                        object4.aClass30_Sub2_Sub4_48.Render(0, anInt458, anInt459, anInt460, anInt461, object4.anInt46 - anInt455, object4.anInt45 - anInt456 - object4.anInt52, object4.anInt47 - anInt457, object4.uid);
                }
                if (class30_sub3_1.anInt1328 != 0)
                {
                    Object2 class26 = class30_sub3_1.obj2;
                    if (class26 != null && !method322(l, i, j, class26.aClass30_Sub2_Sub4_504.modelHeight))
                        if ((class26.anInt502 & class30_sub3_1.anInt1328) != 0)
                            class26.aClass30_Sub2_Sub4_504.Render(class26.anInt503, anInt458, anInt459, anInt460, anInt461, class26.anInt500 - anInt455, class26.anInt499 - anInt456, class26.anInt501 - anInt457, class26.uid);
                        else
                            if ((class26.anInt502 & 0x300) != 0)
                            {
                                int l2 = class26.anInt500 - anInt455;
                                int j3 = class26.anInt499 - anInt456;
                                int i4 = class26.anInt501 - anInt457;
                                int k5 = class26.anInt503;
                                int j6;
                                if (k5 == 1 || k5 == 2)
                                    j6 = -l2;
                                else
                                    j6 = l2;
                                int l7;
                                if (k5 == 2 || k5 == 3)
                                    l7 = -i4;
                                else
                                    l7 = i4;
                                if ((class26.anInt502 & 0x100) != 0 && l7 >= j6)
                                {
                                    int i9 = l2 + anIntArray463[k5];
                                    int i10 = i4 + anIntArray464[k5];
                                    class26.aClass30_Sub2_Sub4_504.Render(k5 * 512 + 256, anInt458, anInt459, anInt460, anInt461, i9, j3, i10, class26.uid);
                                }
                                if ((class26.anInt502 & 0x200) != 0 && l7 <= j6)
                                {
                                    int j9 = l2 + anIntArray465[k5];
                                    int j10 = i4 + anIntArray466[k5];
                                    class26.aClass30_Sub2_Sub4_504.Render(k5 * 512 + 1280 & 0x7ff, anInt458, anInt459, anInt460, anInt461, j9, j3, j10, class26.uid);
                                }
                            }
                    Object1 class10_2 = class30_sub3_1.obj1;
                    if (class10_2 != null)
                    {
                        if ((class10_2.orientation1 & class30_sub3_1.anInt1328) != 0 && !method321(l, i, j, class10_2.orientation1))
                            class10_2.aClass30_Sub2_Sub4_279.Render(0, anInt458, anInt459, anInt460, anInt461, class10_2.anInt274 - anInt455, class10_2.anInt273 - anInt456, class10_2.anInt275 - anInt457, class10_2.uid);
                        if ((class10_2.orientation & class30_sub3_1.anInt1328) != 0 && !method321(l, i, j, class10_2.orientation))
                            class10_2.aClass30_Sub2_Sub4_278.Render(0, anInt458, anInt459, anInt460, anInt461, class10_2.anInt274 - anInt455, class10_2.anInt273 - anInt456, class10_2.anInt275 - anInt457, class10_2.uid);
                    }
                }
                if (k < anInt437 - 1)
                {
                    Ground class30_sub3_12 = groundArray[k + 1][i][j];
                    if (class30_sub3_12 != null && class30_sub3_12.aBoolean1323)
                        aClass19_477.Push(class30_sub3_12);
                }
                if (i < anInt453)
                {
                    Ground class30_sub3_13 = aclass30_sub3[i + 1][j];
                    if (class30_sub3_13 != null && class30_sub3_13.aBoolean1323)
                        aClass19_477.Push(class30_sub3_13);
                }
                if (j < anInt454)
                {
                    Ground class30_sub3_14 = aclass30_sub3[i][j + 1];
                    if (class30_sub3_14 != null && class30_sub3_14.aBoolean1323)
                        aClass19_477.Push(class30_sub3_14);
                }
                if (i > anInt453)
                {
                    Ground class30_sub3_15 = aclass30_sub3[i - 1][j];
                    if (class30_sub3_15 != null && class30_sub3_15.aBoolean1323)
                        aClass19_477.Push(class30_sub3_15);
                }
                if (j > anInt454)
                {
                    Ground class30_sub3_16 = aclass30_sub3[i][j - 1];
                    if (class30_sub3_16 != null && class30_sub3_16.aBoolean1323)
                        aClass19_477.Push(class30_sub3_16);
                }
            } while (true);
        }
        private bool method287(int i, int j, int k, int l, int i1, int j1, int k1,
				int l1, Animable class30_sub2_sub4, int i2, bool flag, int j2, sbyte byte0)
        {
            for (int k2 = j; k2 < j + l; k2++)
            {
                for (int l2 = k; l2 < k + i1; l2++)
                {
                    if (k2 < 0 || l2 < 0 || k2 >= anInt438 || l2 >= anInt439)
                        return false;
                    Ground class30_sub3 = groundArray[i][k2][l2];
                    if (class30_sub3 != null && class30_sub3.anInt1317 >= 5)
                        return false;
                }

            }

            Object5 class28 = new Object5();
            class28.uid = j2;
            class28.aByte530 = byte0;
            class28.anInt517 = i;
            class28.anInt519 = j1;
            class28.anInt520 = k1;
            class28.anInt518 = l1;
            class28.aClass30_Sub2_Sub4_521 = class30_sub2_sub4;
            class28.anInt522 = i2;
            class28.anInt523 = j;
            class28.anInt525 = k;
            class28.anInt524 = (j + l) - 1;
            class28.anInt526 = (k + i1) - 1;
            for (int i3 = j; i3 < j + l; i3++)
            {
                for (int j3 = k; j3 < k + i1; j3++)
                {
                    int k3 = 0;
                    if (i3 > j)
                        k3++;
                    if (i3 < (j + l) - 1)
                        k3 += 4;
                    if (j3 > k)
                        k3 += 8;
                    if (j3 < (k + i1) - 1)
                        k3 += 2;
                    for (int l3 = i; l3 >= 0; l3--)
                        if (groundArray[l3][i3][j3] == null)
                            groundArray[l3][i3][j3] = new Ground(l3, i3, j3);

                    Ground class30_sub3_1 = groundArray[i][i3][j3];
                    class30_sub3_1.obj5Array[class30_sub3_1.anInt1317] = class28;
                    class30_sub3_1.anIntArray1319[class30_sub3_1.anInt1317] = k3;
                    class30_sub3_1.anInt1320 |= k3;
                    class30_sub3_1.anInt1317++;
                }

            }

            if (flag)
                obj5Cache[obj5CacheCurrPos++] = class28;
            return true;
        }