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

objeval + loc/where/rloc/room/elock can return unexpected results #687

Open
brazilofmux opened this issue Mar 24, 2015 · 0 comments
Open
Assignees

Comments

@brazilofmux
Copy link
Owner

Original issue 685 created by brazilofmux on 2015-02-18T00:43:34.000Z:

Reported by Thenomain@BrazilMUX

> What steps will reproduce the problem?
@@ Assume we're a wizard for this demonstration.

@name me=SomeWiz

@pcreate SomePlayer=blah

@tel *SomePlayer=# 0
@tel # 10

@@ Now we're in different rooms.

@set %!=unfindable

th objeval(_SomePlayer,loc(_SomeWiz))
(returns # 10)

LOGOUT
connect SomePlayer blah
th loc(*SomeWiz)
(returns #-1)

> What is the expected output? What do you see instead?
I expected the objeval() line to return #-1 (unfindable). I see # 10 instead (the actual location *SomeWiz is in).

'help objeval' states: Allows you to evaluate <expression> from the viewpoint of <object>.

This does not seem to be true.

The culprit is either "the help file needs to be written more precisely" or:

$ grep locatable functions.cpp
else if (locatable(executor, it, enactor))
else if (locatable(executor, it, enactor))
else if (locatable(executor, it, enactor))
else if (locatable(executor, it, enactor))
else if (!locatable(executor, it, enactor))
else if (!locatable(executor, victim, enactor))

And note from predicates.cpp:
bool locatable(dbref player, dbref it, dbref enactor)
{
if (!Good_obj(it))
{
return false;
}

dbref loc_it = where_is(it);

// Succeed if we can examine the target, if we are the target, if we can
// examine the location, if a wizard caused the lookup, or if the target
// caused the lookup.
//
if (  Examinable(player, it)
   || Find_Unfindable(player)
   || loc_it == player
   || (  loc_it != NOTHING
      &amp;&amp; (  Examinable(player, loc_it)
         || loc_it == where_is(player)))
   || Wizard(enactor)
   || it == enactor)
{
    return true;
}

Specifically "Wizard(enactor)".

Is this logic correct? Is the documentation correct?

@brazilofmux brazilofmux self-assigned this Mar 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant