From 4de22aa6fed2bd64d62cd396746f8abd23ec7d74 Mon Sep 17 00:00:00 2001 From: Daramant Date: Fri, 29 Sep 2017 02:08:53 +0300 Subject: [PATCH 1/2] Fix moving to elevator. --- localrunner/world/core/game_objects/passenger.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/localrunner/world/core/game_objects/passenger.py b/localrunner/world/core/game_objects/passenger.py index e012ef4..7277d28 100644 --- a/localrunner/world/core/game_objects/passenger.py +++ b/localrunner/world/core/game_objects/passenger.py @@ -161,8 +161,12 @@ def on_tick(self): if self.elevator.floor == self.floor and self.elevator.is_filling(): if self.elevator.x < 0 and self.x > self.elevator.x: self.move(x=sign(self.elevator.x)) + elif self.elevator.x < 0 and self.x < self.elevator.x: + self.move(x=-sign(self.elevator.x)) elif self.elevator.x > 0 and self.x < self.elevator.x: self.move(x=sign(self.elevator.x)) + elif self.elevator.x > 0 and self.x > self.elevator.x: + self.move(x=-sign(self.elevator.x)) elif self.elevator.floor == self.from_floor and self.elevator.can_enter(): self.elevator.enter(self) self.state = self.PASSENGER_STATE['using_elevator'] From c1f0f1b392e3ad4a6738ce03f810da9af3cea637 Mon Sep 17 00:00:00 2001 From: Daramant Date: Fri, 29 Sep 2017 02:10:08 +0300 Subject: [PATCH 2/2] Fix formatting. --- localrunner/world/core/game_objects/passenger.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/localrunner/world/core/game_objects/passenger.py b/localrunner/world/core/game_objects/passenger.py index 7277d28..105a0dd 100644 --- a/localrunner/world/core/game_objects/passenger.py +++ b/localrunner/world/core/game_objects/passenger.py @@ -161,11 +161,11 @@ def on_tick(self): if self.elevator.floor == self.floor and self.elevator.is_filling(): if self.elevator.x < 0 and self.x > self.elevator.x: self.move(x=sign(self.elevator.x)) - elif self.elevator.x < 0 and self.x < self.elevator.x: + elif self.elevator.x < 0 and self.x < self.elevator.x: self.move(x=-sign(self.elevator.x)) elif self.elevator.x > 0 and self.x < self.elevator.x: self.move(x=sign(self.elevator.x)) - elif self.elevator.x > 0 and self.x > self.elevator.x: + elif self.elevator.x > 0 and self.x > self.elevator.x: self.move(x=-sign(self.elevator.x)) elif self.elevator.floor == self.from_floor and self.elevator.can_enter(): self.elevator.enter(self)