bug fix: si desapareixia la maquina de cafe, ja no eixia mes
This commit is contained in:
@@ -686,6 +686,9 @@ void Game::freeItems() {
|
|||||||
if (!items_.empty()) {
|
if (!items_.empty()) {
|
||||||
for (int i = items_.size() - 1; i >= 0; --i) {
|
for (int i = items_.size() - 1; i >= 0; --i) {
|
||||||
if (!items_[i]->isEnabled()) {
|
if (!items_[i]->isEnabled()) {
|
||||||
|
if (items_[i]->getType() == ItemType::COFFEE_MACHINE) {
|
||||||
|
coffee_machine_enabled_ = false;
|
||||||
|
}
|
||||||
items_.erase(items_.begin() + i);
|
items_.erase(items_.begin() + i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2050,6 +2053,7 @@ void Game::handleDebugEvents(const SDL_Event& event) {
|
|||||||
for (const auto& player : players_) {
|
for (const auto& player : players_) {
|
||||||
if (player->isPlaying()) {
|
if (player->isPlaying()) {
|
||||||
createItem(ItemType::COFFEE_MACHINE, player->getPosX(), param.game.game_area.rect.y - Item::COFFEE_MACHINE_HEIGHT);
|
createItem(ItemType::COFFEE_MACHINE, player->getPosX(), param.game.game_area.rect.y - Item::COFFEE_MACHINE_HEIGHT);
|
||||||
|
coffee_machine_enabled_ = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user