diff --git a/evennia/contrib/game_systems/containers/containers.py b/evennia/contrib/game_systems/containers/containers.py index 27024a62ad..67c9494314 100644 --- a/evennia/contrib/game_systems/containers/containers.py +++ b/evennia/contrib/game_systems/containers/containers.py @@ -131,15 +131,16 @@ class CmdContainerLook(CmdLook): if not target: self.msg("You have no location to look at!") return - elif self.rhs: - # we are looking in something, find that first - container = caller.search(self.rhs) - if not container: - return + else: + if self.rhs: + # we are looking in something, find that first + container = caller.search(self.rhs) + if not container: + return - target = caller.search(self.lhs, location=container) - if not target: - return + target = caller.search(self.lhs, location=container) + if not target: + return desc = caller.at_look(target) # add the type=look to the outputfunc to make it diff --git a/evennia/contrib/game_systems/containers/tests.py b/evennia/contrib/game_systems/containers/tests.py index aab8f631b2..ded594708e 100644 --- a/evennia/contrib/game_systems/containers/tests.py +++ b/evennia/contrib/game_systems/containers/tests.py @@ -31,6 +31,9 @@ class TestContainerCmds(BaseEvenniaCommandTest): # move it into a non-container object and look at it there too self.obj1.location = self.obj2 self.call(CmdContainerLook(), "obj in obj2", "Obj") + # make sure normal looking works too + self.call(CmdContainerLook(), "obj2", "Obj2") + self.call(CmdContainerLook(), "", "Room") def test_get_and_put(self): # get normally @@ -59,4 +62,4 @@ class TestContainerCmds(BaseEvenniaCommandTest): self.obj1.location = self.char1 self.call(CmdPut(), "obj in box", "You can't fit anything else in a Box.") - \ No newline at end of file +