Hopefully last commit
This commit is contained in:
14
items/item.c
14
items/item.c
@@ -67,7 +67,7 @@ OrientDirection rotateMainDirection(OrientDirection dir, int steps) {
|
||||
int newIndex = (index + steps) % count;
|
||||
if (newIndex < 0) newIndex += count;
|
||||
|
||||
return (OrientDirection)mainDirs[newIndex];
|
||||
return (OrientDirection) mainDirs[newIndex];
|
||||
}
|
||||
|
||||
// Map 8 directions to main 4 for code output
|
||||
@@ -225,9 +225,17 @@ void updateItems() {
|
||||
|
||||
|
||||
if (!putOntoNext(itm, nx, ny, next, &ntt, newLane) && (next->type != TYPE_BELT || newLane >= 2)) {
|
||||
bool alreadyPresent = false;
|
||||
for (uint8_t nLane = 0; nLane < ItemSlotCount; nLane++) {
|
||||
if (putOntoNext(itm, nx, ny, next, &ntt, nLane)) {
|
||||
break;
|
||||
if (next->items[nLane].type == itm->type) {
|
||||
alreadyPresent = true;
|
||||
}
|
||||
}
|
||||
if (!alreadyPresent) {
|
||||
for (uint8_t nLane = 0; nLane < ItemSlotCount; nLane++) {
|
||||
if (putOntoNext(itm, nx, ny, next, &ntt, nLane)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
12
items/item.h
12
items/item.h
@@ -22,6 +22,8 @@ typedef enum ItemType {
|
||||
TYPE_TURRET,
|
||||
TYPE_SPLITTER,
|
||||
TYPE_CORE,
|
||||
TYPE_AMMOCRAFTER,
|
||||
TYPE_WIRECRAFTER,
|
||||
IRON_ORE = ITEMREGISTRY_SIZE / 2,
|
||||
SILVER_ORE,
|
||||
GOLD_ORE,
|
||||
@@ -30,11 +32,19 @@ typedef enum ItemType {
|
||||
SILVER_INGOT,
|
||||
GOLD_INGOT,
|
||||
PLATINUM_INGOT,
|
||||
LOG,
|
||||
IRON_BULLET,
|
||||
SILVER_BULLET,
|
||||
GOLD_BULLET,
|
||||
PLATINUM_BULLET,
|
||||
LOG,
|
||||
SILVER_PLATE,
|
||||
GOLD_PLATE,
|
||||
PLATINUM_PLATE,
|
||||
IRON_PLATE,
|
||||
SILVER_ROD,
|
||||
GOLD_ROD,
|
||||
PLATINUM_ROD,
|
||||
IRON_ROD,
|
||||
} ItemType;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user