summaryrefslogtreecommitdiffhomepage
path: root/src/scenery.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-04-07 21:08:32 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-04-07 21:08:32 +0200
commit85ade98d72850f1db2549f665c4fc51961e1611a (patch)
tree40a7c1f15685ad16710beb22af1f740e5048a224 /src/scenery.cpp
parent21eaaee936a47742f59eb6b5665422de2bd8e7ae (diff)
prevent character clipping through walls/doors
Diffstat (limited to 'src/scenery.cpp')
-rw-r--r--src/scenery.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/scenery.cpp b/src/scenery.cpp
index 873dcf93..fadc0471 100644
--- a/src/scenery.cpp
+++ b/src/scenery.cpp
@@ -97,7 +97,7 @@ Vector2 scenery::depth_offset() const
if (sc_type == scenery_type::door)
{
const bool is_open = frame != atlas->info().nframes-1;
- ret += Vector2(is_open ? sc_offset : -sc_offset, 0);
+ ret += Vector2(sc_offset * is_open, 0);
constexpr auto off_opened = Vector2(-1, 0);
constexpr auto off_closed = Vector2(0, 0);
const auto vec = is_open ? off_opened : off_closed;