From 8446cb2ecffb54bc52f5e9d72e98d2bb7d17b64b Mon Sep 17 00:00:00 2001 From: minjaesong Date: Mon, 22 May 2023 11:56:57 +0900 Subject: [PATCH] fix: door won't consider the distance of the actor --- .../modulebasegame/gameactors/FixtureSwingingDoorBase.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureSwingingDoorBase.kt b/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureSwingingDoorBase.kt index ee0c24caa..dd38b9abc 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureSwingingDoorBase.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureSwingingDoorBase.kt @@ -372,7 +372,10 @@ open class FixtureSwingingDoorBase : FixtureBase { }*/ - val amicableActors = INGAME.actorContainerActive.filterIsInstance() + val amicableActors = INGAME.actorContainerActive.filterIsInstance().filter { + // actor.ontheLeftSideOfDoor and actor.ontheRightSideOfDoor won't consider the distance of the actor so we filter the actors further + this.hitbox.containsHitbox(INGAME.world.width * TILE_SIZED, it.hitbox) + } var nobodyIsThere = true