start turret

This commit is contained in:
2025-06-10 16:29:17 +02:00
parent 79c8b747cd
commit a17e3abbff
17 changed files with 213 additions and 68 deletions

View File

@@ -30,7 +30,9 @@ SDL_Color breakingBarColor = {128, 128, 0, 255};
void setActivePlayerSlot(Player *plr, ItemType activeSlotIndex) {
activeSlotIndex = activeSlotIndex % itemRegistryIndex;
if((activeSlotIndex < tileTypeIndex || (activeSlotIndex < itemRegistryIndex && activeSlotIndex >= ITEMREGISTRY_SIZE / 2)) && activeSlotIndex > 0) {
plr->inventory.activeSlotIndex = activeSlotIndex;
}
}
void moveActivePlayerSlot(Player *plr, bool up, bool seek) {
@@ -174,7 +176,7 @@ void renderPlayer(Player *plr) {
ItemType itemIndex = plr->inventory.activeSlotIndex;
//SDL_Texture *itemTex;
char itemStringCount[6];
if (itemIndex < itemRegistryIndex && itemIndex > 0) {
if ((itemIndex < tileTypeIndex || (itemIndex < itemRegistryIndex && itemIndex >= ITEMREGISTRY_SIZE / 2)) && itemIndex > 0) {
plr->cursor.heldItemRect.x = plr->cursor.windowX;
plr->cursor.heldItemRect.y = plr->cursor.windowY;
//itemTex = ItemRegistry[itemIndex].textureOnBelt[plr->cursor.direction];