83e4eec5 by Barry

Bug fixes for exits

1 parent eded01f8
......@@ -85,8 +85,9 @@ class CommandHandler(object):
# store the exit name
ex = self.params.lower().strip()
exits = roomloader.get_exits(self.players[self.id]["room"])
# if the specified exit is found in the room's exits list
if ex in roomloader.get_exits(self.players[self.id]["room"]):
if ex in exits:
# go through all the players in the game
for pid, pl in self.players.items():
# if player is in the same room and isn't the player
......@@ -100,11 +101,11 @@ class CommandHandler(object):
# update the player's current room to the one the exit leads to
if roomloader.get_title(ex) == None:
if roomloader.get_title(exits[ex]) == None:
self.mud.send_message(self.id, "An invisible force prevents you from going in that direction.")
return True
else:
self.players[self.id]["room"] = roomloader.get_exits(self.players[self.id]["room"])[ex]
self.players[self.id]["room"] = exits[ex]
self.room = ex
# go through all the players in the game
......
{
"title": "Tavern",
"description": "You're in a cozy tavern warmed by an open fire.",
"exits": {"outside": "Outside", "behind bar": "Room001", "dark": "Dark"},
"exits": {"outside": "Outside", "behind": "Room001", "dark": "Dark"},
"look_items": {
"bar": "The bar is a long wooden plank thrown over roughly hewn barrels.",
"barrel,barrels": "The old barrels bands are thick with oxidation and stained with the purple of spilled wine.",
......