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