ID:2717458
 
Not a bug
BYOND Version:514
Operating System:Windows 10 Home 64-bit
Web Browser:Firefox 92.0
Applies to:DM Language
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND forums.
Descriptive Problem Summary:

Adding a verb or proc to the client's verbs list causes any overridden definitions of that verb to be ignored.

Numbered Steps to Reproduce Problem:

Create a simple verb.
Add it to the client's verb list (I assume the same holds true for mob verbs)
Override the verb definition
Execute the verb from the client

Code Snippet (if applicable) to Reproduce Problem:
MyDatum
verb // the bug appears if the definition is a verb, or a proc called as a verb
MyVerb()
world << "Called from the original definition."
world << "My verb executed!"


client
var/override = TRUE // This should cause the overridden proc to execute its code


New()
..()
if(!(/MyDatum/verb/MyVerb in verbs)) // if they don't have the verb
verbs += /MyDatum/verb/MyVerb // give them the verb
// I suspect the problem lies here


// This overridden definition is never called:
MyDatum
MyVerb()
world << "Called from the overridden definition."
var/client/C = usr.client
if(C)
if(C.override)
world << "My verb was overridden!"
else
..()


// This other verb works as expected.
client
verb
MyOtherVerb()
world << "Called from the original definition"
world << "My other verb executed!"


// This overridden definition is properly called
client
MyOtherVerb()
world << "Called from the overridden definition"
if(override)
world << "My other verb was overridden!"
else
..()


Expected Results:

The overridden definition of the verb should execute when called by the client

Actual Results:

That code is never executed.

Does the problem occur:
Every time? Or how often? Everytime
In other games? In at least two separate projects
In other user accounts? Irrelevant.
On other computers? I assume so. I only have one.

When does the problem NOT occur?

If the verbs are not dynamically added to the client's verbs list, an overridden verb executes properly when called by the client.

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.)

I have not noticed the bug previously, but I suspect it is ancient.

I just tested in version 354. The bug exists that far back, at least.

Workarounds:

None that I know of, if you need to override a verb which is added to the client's verb list.
This doesn't seem like a bug to me, but I'm not sure how to explain it.

Normally, overrides are in child types. When a proc is called on an instance of the child type (in the proc, src is the child), the child's override is called, which can call the parent with ..().

But when an added non-client verb is called on a client (in the verb, src is actually the client), the client doesn't have any overrides because the client isn't even the type that has the verb in the first place.

Basically, overrides are found according to the src that the proc/verb is run on.
Lummox JR resolved issue (Not a bug)
Kaiochao's explanation hits the nail on the head.

I could see some logic in changing this behavior, but then I think the real problem is that overriding an existing proc on the same type should involve making the older proc "unlisted".
Unless the proc is in a library, but I suppose a child type would do just as well. Meh.
This behavior is however subject to change in the future, since as I mentioned the overload should really change the parent to unlisted.