Closed scrom closed 8 years ago
In both these cases I've gone for the simplest common option - if there's one in the player inventory and one at the location, it'll ask the player to be more specific.
fixed & tested
Minor improvement. If one of the items is in a container, player can now specify the cotainer
Initially I thought "examine" / "read" should try location before player for object. This may be very far-reaching (this is handled by getObjectFromPlayerOrLocation)
Possibly more sensible would be to determine what object the players last action was against. If the next action is against an object with the same name, it should use the same (if available).
This is currently a problem where if a player is carrying a "book" and a location also has a book. Saying "examine" or "read" book - when walking into location will describe the one in the player inventory.
It might be as simple as adding an optional "precedence" parameter to getObjectFromPlayerOrLocation that chooses which to try first