Files
factorygame/tiles/core.c

29 lines
824 B
C

//
// 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;
}