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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user