I'm trying to restrict mob verb access control by moving them inside of the contents of items. It doesn't seem to be working quite right because set src = usr.loc doesn't seem to do anything for an obj. Maybe even all movable atoms. Maybe even turfs. I haven't tried them all.
In scenarios where the verbs are being secured by location, this can affect security.
Numbered Steps to Reproduce Problem:
Basically, I'm having the player's mob move inside of the objects and using the object's Enter() to control access control to their verbs.
So the player is now in the object's .contents list.
With the verb on the object set to "set src = usr.loc" the verb is not visible and does not activate.
With the verb on the object set to "set src in usr.loc" the verb is visible, but will not generate any response upon activation.
Code Snippet (if applicable) to Reproduce Problem:
obj/device/commandpod
verb/btnJumpToShipView()
set src = usr.loc
set name = "Ship view"
set desc = "Jump to the ship's view!"
Expected Results:
Upon entering the object with the verb, all verbs with src = usr.loc should become accessible.
Actual Results:
Upon putting the player's mob inside of the object:
With the verb on the object set to "set src = usr.loc" the verb is not visible and does not activate.
With the verb on the object set to "set src in usr.loc" the verb is visible, but will not generate any response upon activation.
Does the problem occur:
Every time that I have noticed.
When does the problem NOT occur?
I'm not sure.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
Unknown.
Workarounds:
set src in view(0)
Works fine, although it's not ideal as it means everybody who stands in the same turf at the object can access the verb. To get around this, add:
if (!(usr in contents)) return()
To the start of the verb after the settings.
Alternately (and this is probably a better solution) make that verb a proc, .Add it to the user verbs list when the user enters, .Remove it from the user verbs list when the user leaves.
Everything worked as I would have expected. I was able to see the GetOut verb in the list and access it.
If you can wrangle up a demo that shows the problem in action it will probably help. There may be some contributing factor that doesn't occur in my test case.