Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_obj_here counting is inconsistent. #155

Open
mattgodbolt opened this issue Aug 22, 2020 · 0 comments
Open

get_obj_here counting is inconsistent. #155

mattgodbolt opened this issue Aug 22, 2020 · 0 comments
Labels
bug Something isn't working code-cruft Internal code cleanups

Comments

@mattgodbolt
Copy link
Owner

do_look uses (eventually) get_obj_here(). That delegates to get_obj_list, then get_obj_carry, then get_obj_wear.

That means it looks in the room, then the player's non-worn inventory, then their worn inventory.

However, each of those functions starts counting from 1 again: so if there is a "bob" in the room, and you're also holding and wearing a bob: get_obj_here(ch, "bob") will only ever find the room one.

get_obj_here is used directly by look in XX. that is look in bob will look in the room, as will look in 1.bob.

look in 2.bob will fail on the room, but then will also fail in the inventory and worn!

regular look XX has custom code to handle this. We should probably unify this. Low priority though.

@mattgodbolt mattgodbolt added bug Something isn't working code-cruft Internal code cleanups labels Aug 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working code-cruft Internal code cleanups
Projects
None yet
Development

No branches or pull requests

1 participant