[planetblupi] 06/15: Ensure that it's not possible to put fire on all objects
Didier Raboud
odyx at moszumanska.debian.org
Thu Mar 15 07:59:40 UTC 2018
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch debian/master
in repository planetblupi.
commit e7dd0ec7c753341ab51b8ccfdeed15de55b51f75
Author: Mathieu Schroeter <mathieu at schroetersa.ch>
Date: Sun Feb 18 23:31:43 2018 +0100
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);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/planetblupi.git
More information about the Pkg-games-commits
mailing list