Hopefully last commit
This commit is contained in:
29
tiles/core.c
Normal file
29
tiles/core.c
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// Created by bruno on 11.6.2025.
|
||||
//
|
||||
|
||||
#include "core.h"
|
||||
#include "../player/player.h"
|
||||
|
||||
void updateCore(Tile *tile) {
|
||||
for (size_t slot = 0; slot < ItemSlotCount; slot++) {
|
||||
ItemOnBelt *item = &tile->items[slot];
|
||||
if (item->type == TYPE_AIR) {
|
||||
continue;
|
||||
} else if (item->type < ITEMREGISTRY_SIZE) {
|
||||
mainPlayer.inventory.slotCounts[item->type]++;
|
||||
item->type = TYPE_AIR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void initCoreTile() {
|
||||
// Force slot assignments for allowed items based on recipes
|
||||
for (size_t i = 0; i < ITEMREGISTRY_SIZE; i++) {
|
||||
for (size_t slot = 0; slot < ItemSlotCount; slot++) {
|
||||
TileRegistry[TYPE_CORE].allowedInItems[slot][i] = true;
|
||||
}
|
||||
}
|
||||
// Animation and behavior settings
|
||||
TileRegistry[TYPE_CORE].needsTicks = true;
|
||||
}
|
Reference in New Issue
Block a user