From e7dd0ec7c753341ab51b8ccfdeed15de55b51f75 Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Sun, 18 Feb 2018 23:31:43 +0100 Subject: [PATCH] Ensure that it's not possible to put fire on all objects Only burnable objects can have a fire. Note that it's possible to re-enable the previous feature with the --restore-bugs argument. - It fixes issue #54. --- src/decor.cxx | 10 ++++++++++ src/event.cxx | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/decor.cxx b/src/decor.cxx index 2090904..ca2af57 100644 --- a/src/decor.cxx +++ b/src/decor.cxx @@ -382,6 +382,11 @@ CDecor::PutFloor (Point cel, Sint32 channel, Sint32 icon) m_decor[cel.x / 2][cel.y / 2].floorChannel = channel; m_decor[cel.x / 2][cel.y / 2].floorIcon = icon; + if ( + !g_restoreBugs && m_decor[cel.x / 2][cel.y / 2].fire && + !this->CanBurn (cel)) + m_decor[cel.x / 2][cel.y / 2].fire = 0; + m_bGroundRedraw = true; //? SubDrapeau(cel); // on pourra de nouveau planter un drapeau @@ -403,6 +408,11 @@ CDecor::PutObject (Point cel, Sint32 channel, Sint32 icon) m_decor[cel.x / 2][cel.y / 2].objectChannel = channel; m_decor[cel.x / 2][cel.y / 2].objectIcon = icon; + if ( + !g_restoreBugs && m_decor[cel.x / 2][cel.y / 2].fire && + !this->CanBurn (cel)) + m_decor[cel.x / 2][cel.y / 2].fire = 0; + SubDrapeau (cel); // on pourra de nouveau planter un drapeau return true; diff --git a/src/event.cxx b/src/event.cxx index 1ede8bf..8ad1a02 100644 --- a/src/event.cxx +++ b/src/event.cxx @@ -4419,7 +4419,8 @@ CEvent::BuildDown (Point pos, Uint16 mod, const SDL_Event * event, bool bMix) if (menu == 0) // supprime ? m_pDecor->SetFire (cel, false); - if (menu == 1) // ajoute ? + + if (menu == 1 && (g_restoreBugs || m_pDecor->CanBurn (cel))) // ajoute ? m_pDecor->SetFire (cel, true); }