fix: tweaked around the 'look' command when used on players

This commit is contained in:
Marlow Alfonso 2023-12-07 00:13:30 +00:00
parent a196290e36
commit 6094480fea
1 changed files with 6 additions and 1 deletions

View File

@ -7,7 +7,8 @@ def help(mud, id):
mud.send_message(id, '''This are the currently available commands:
* say <message>: Says something to everyone in the room.
* go <exit>: Enters an exit.
* look: Gives a description of the room.
* look: Gives a description of the room. Use it in a players to see info
about them. Use 'me' to see info about you.
* open <exit> <room>: (Only available for the builders of the room) creates
an exit to another room.
* build <room> <return> <description>: Creates a room. The return param is
@ -59,9 +60,13 @@ def look(mud, id, players, rooms, params):
for pid, pl in players.items():
if params_list[0] == "me":
mud.send_message(id, players[id]["description"])
mud.send_message(id, "species: {}"
.format(players[id]["species"]))
break
elif params_list[0] == pl["name"]:
mud.send_message(id, pl["description"])
mud.send_message(id, "species: {}"
.format(players[pid]["species"]))
return
room = rooms[players[id]["room"]]
mud.send_message(id, room["description"])