From 62b73d6f41c0cc3b046e742555b32bc753158f01 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Thu, 2 Oct 2025 12:04:17 +0200 Subject: [PATCH] bug fix: si desapareixia la maquina de cafe, ja no eixia mes --- source/sections/game.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/sections/game.cpp b/source/sections/game.cpp index 2d59d0b..db1b058 100644 --- a/source/sections/game.cpp +++ b/source/sections/game.cpp @@ -686,6 +686,9 @@ void Game::freeItems() { if (!items_.empty()) { for (int i = items_.size() - 1; i >= 0; --i) { if (!items_[i]->isEnabled()) { + if (items_[i]->getType() == ItemType::COFFEE_MACHINE) { + coffee_machine_enabled_ = false; + } items_.erase(items_.begin() + i); } } @@ -2050,6 +2053,7 @@ void Game::handleDebugEvents(const SDL_Event& event) { for (const auto& player : players_) { if (player->isPlaying()) { createItem(ItemType::COFFEE_MACHINE, player->getPosX(), param.game.game_area.rect.y - Item::COFFEE_MACHINE_HEIGHT); + coffee_machine_enabled_ = true; break; } }