···
1272
1272
1273
1273
}
1274
1274
1275
1275
-
public void method26(int x, int y) {
1276
1276
-
LinkedList class6 = groundItems[plane][x][y];
1277
1277
-
if (class6 == null) {
1278
1278
-
currentScene.method262(plane, x, y);
1275
1275
+
public void processGroundItems(int x, int y) {
1276
1276
+
LinkedList linkedList = groundItems[plane][x][y];
1277
1277
+
if (linkedList == null) {
1278
1278
+
currentScene.clearGroundItem(plane, x, y);
1279
1279
return;
1280
1280
}
1281
1281
-
int k = 0xfa0a1f01;
1282
1282
-
Object obj = null;
1283
1283
-
for (Item class50_sub1_sub4_sub1 = (Item) class6.first(); class50_sub1_sub4_sub1 != null; class50_sub1_sub4_sub1 = (Item) class6
1281
1281
+
int maxValue = 0xfa0a1f01;
1282
1282
+
Object mostValuable = null;
1283
1283
+
for (Item item = (Item) linkedList.first(); item != null; item = (Item) linkedList
1284
1284
.next()) {
1285
1285
-
ItemDefinition class16 = ItemDefinition.lookup(class50_sub1_sub4_sub1.itemId);
1286
1286
-
int l = class16.value;
1287
1287
-
if (class16.stackable)
1288
1288
-
l *= class50_sub1_sub4_sub1.itemCount + 1;
1289
1289
-
if (l > k) {
1290
1290
-
k = l;
1291
1291
-
obj = class50_sub1_sub4_sub1;
1285
1285
+
ItemDefinition definition = ItemDefinition.lookup(item.itemId);
1286
1286
+
int value = definition.value;
1287
1287
+
if (definition.stackable)
1288
1288
+
value *= item.itemCount + 1;
1289
1289
+
if (value > maxValue) {
1290
1290
+
maxValue = value;
1291
1291
+
mostValuable = item;
1292
1292
}
1293
1293
}
1294
1294
1295
1295
-
class6.addFirst(((Node) (obj)));
1296
1296
-
Object obj1 = null;
1297
1297
-
Object obj2 = null;
1298
1298
-
for (Item class50_sub1_sub4_sub1_1 = (Item) class6.first(); class50_sub1_sub4_sub1_1 != null; class50_sub1_sub4_sub1_1 = (Item) class6
1295
1295
+
linkedList.addFirst(((Node) (mostValuable)));
1296
1296
+
Object first = null;
1297
1297
+
Object second = null;
1298
1298
+
for (Item item = (Item) linkedList.first(); item != null; item = (Item) linkedList
1299
1299
.next()) {
1300
1300
-
if (class50_sub1_sub4_sub1_1.itemId != ((Item) (obj)).itemId && obj1 == null)
1301
1301
-
obj1 = class50_sub1_sub4_sub1_1;
1302
1302
-
if (class50_sub1_sub4_sub1_1.itemId != ((Item) (obj)).itemId
1303
1303
-
&& class50_sub1_sub4_sub1_1.itemId != ((Item) (obj1)).itemId
1304
1304
-
&& obj2 == null)
1305
1305
-
obj2 = class50_sub1_sub4_sub1_1;
1300
1300
+
if (item.itemId != ((Item) (mostValuable)).itemId && first == null)
1301
1301
+
first = item;
1302
1302
+
if (item.itemId != ((Item) (mostValuable)).itemId
1303
1303
+
&& item.itemId != ((Item) (first)).itemId
1304
1304
+
&& second == null)
1305
1305
+
second = item;
1306
1306
}
1307
1307
1308
1308
-
int i1 = x + (y << 7) + 0x60000000;
1308
1308
+
int key = x + (y << 7) + 0x60000000;
1309
1309
currentScene.method248(method110(y * 128 + 64, x * 128 + 64, (byte) 9, plane), plane,
1310
1310
-
((Renderable) (obj)), ((Renderable) (obj1)), i1, ((Renderable) (obj2)), 2, y, x);
1310
1310
+
((Renderable) (mostValuable)), ((Renderable) (first)), key, ((Renderable) (second)), 2, y, x);
1311
1311
}
1312
1312
1313
1313
···
2560
2560
for (int i14 = placementY; i14 < placementY + 8; i14++)
2561
2561
if (groundItems[plane][k5][i14] != null) {
2562
2562
groundItems[plane][k5][i14] = null;
2563
2563
-
method26(k5, i14);
2563
2563
+
processGroundItems(k5, i14);
2564
2564
}
2565
2565
2566
2566
}
···
7374
7374
currentScene.method242(0);
7375
7375
for (int j5 = 0; j5 < 104; j5++) {
7376
7376
for (int j7 = 0; j7 < 104; j7++)
7377
7377
-
method26(j5, j7);
7377
7377
+
processGroundItems(j5, j7);
7378
7378
7379
7379
}
7380
7380
···
10241
10241
if (groundItems[plane][x][y] == null)
10242
10242
groundItems[plane][x][y] = new LinkedList();
10243
10243
groundItems[plane][x][y].insertBack(item);
10244
10244
-
method26(x, y);
10244
10244
+
processGroundItems(x, y);
10245
10245
}
10246
10246
return;
10247
10247
}
···
10310
10310
if (groundItems[plane][x][y] == null)
10311
10311
groundItems[plane][x][y] = new LinkedList();
10312
10312
groundItems[plane][x][y].insertBack(item);
10313
10313
-
method26(x, y);
10313
10313
+
processGroundItems(x, y);
10314
10314
}
10315
10315
return;
10316
10316
}
···
10331
10331
break;
10332
10332
}
10333
10333
10334
10334
-
method26(x, y);
10334
10334
+
processGroundItems(x, y);
10335
10335
}
10336
10336
}
10337
10337
return;
···
10428
10428
10429
10429
if (list.first() == null)
10430
10430
groundItems[plane][x][y] = null;
10431
10431
-
method26(x, y);
10431
10431
+
processGroundItems(x, y);
10432
10432
}
10433
10433
}
10434
10434
return;
···
504
504
}
505
505
}
506
506
507
507
-
public void method262(int i, int j, int k) {
507
507
+
public void clearGroundItem(int i, int j, int k) {
508
508
SceneTile class50_sub3 = tiles[i][j][k];
509
509
if (class50_sub3 == null) {
510
510
return;