summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-21 15:09:53 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-21 15:09:53 +0100
commit51cc3877d4ab5a6bcb7ce0c4dd2fe2aefb6867a7 (patch)
treed2a2e814fc2307936c1ea0c48a7d18300afebf1b /src
parent142a42b1e9ea3a0b401c139b3b8c7e3220e62c1a (diff)
scenery: don't activate generic static scenery
Diffstat (limited to 'src')
-rw-r--r--src/scenery.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/scenery.cpp b/src/scenery.cpp
index e103d679..cf2c6e98 100644
--- a/src/scenery.cpp
+++ b/src/scenery.cpp
@@ -88,12 +88,22 @@ void scenery::update(float dt, const anim_atlas& anim)
bool scenery::activate(const anim_atlas& atlas)
{
- if (!active) {
- fm_assert(frame == 0 || frame == atlas.info().nframes-1);
- active = true;
- return true;
- } else
- return false;
+ switch (type)
+ {
+ default:
+ case scenery_type::none:
+ case scenery_type::generic:
+ break;
+ case scenery_type::door:
+ if (!active)
+ {
+ fm_assert(frame == 0 || frame == atlas.info().nframes-1);
+ active = true;
+ return true;
+ }
+ break;
+ }
+ return false;
}
} // namespace floormat