I think this is the correct forum this time.
Following is a description of what I assume is a bug. I managed to rule out any human factor.
My stuff behaved like it was magic for a while until I succeeded in isolating the problem.
It seems like functions in a joined class isn't fully aware of what is happening in the real script. The following scripts creates two TStaticVars and assigns anonymous functions to them, one in a joined class-function and one native. The functions both end up with the same identifier, function_1, and whichever function was defined first is overwritten.
A DBNPC:
PHP Code:
function onCreated()
{
join("some_class");
temp.foo = createNewTStaticVarFromAnotherClass();
temp.foo.forkFunctionCollision();
echo(temp.foo.forkFunctionCollision);
temp.bar = new TStaticVar();
temp.bar.secondFunctionCollision = function() {
echo("secondFunctionCollision");
};
temp.bar.secondFunctionCollision();
echo(temp.bar.secondFunctionCollision);
}
some_class:
PHP Code:
function createNewTStaticVarFromAnotherClass()
{
temp.crux = new TStaticVar();
temp.crux.forkFunctionCollision = function() {
echo("forkFunctionCollision");
};
return temp.crux;
}
Output:
Quote:
secondFunctionCollision
function_1
secondFunctionCollision
function_1
|
I assume this is supposed to output:
Quote:
forkFunctionCollision
function_1
secondFunctionCollision
function_2
|
Oh, hello mister inappropriate censorship; I think I'll rename fir
stFunctionCollision() to something else.
That's word censor evasion 101 by the way.