Page 1 of 1

Tolua throws error on equal op between userdatas

Posted: Fri Jun 18, 2010 06:15
by rockoz
Yesterday I was working on CEGUI lua script, I met this error when comparing two CEGUI windows:

Code: Select all

"Attempt to perform operation on an invalid operand"


And my script is like this:

Code: Select all

function OnClicked(args)
    local guiWnd = CEGUI.toWindowEventArgs(args).window
    if guiWnd == oButtonOK then
        --TODO: Start scene
    elseif guiWnd == oButtonCancel then
        --TODO: end scene
    end


When guiWnd is actual equal to oButtonOK, the script works perfect
This error occurs only when guiWnd is different from oButtonOK, e.g. click the oButtonCancel.

I find CEGUI is using Tolua++1.0.92 and has some mod on it. And Tolua++1.0.93 seems to have solved this problem.
But since I am a beginner in Lua :oops: , it is hard to update the Tolua version. So this conclusion is not tested.

Anyone can help?

Re: Tolua throws error on equal op between userdatas

Posted: Mon Jun 21, 2010 08:53
by CrazyEddie
I don't have any info regarding this issue. If what you say is the case, it sounds like an issue with tolua++, so there's not much we can do about that except confirm the issue, confirm the fix, and apply it ;) I'll add a ticket so that this is not forgotten.

In the mean time, I think a workaround solution is perhaps to compare the window names rather than the window references directly.

HTH, and thanks for raising the issue.

CE.

Re: Tolua throws error on equal op between userdatas

Posted: Mon Jun 21, 2010 10:13
by rockoz
Thank you for your reply CE

Code: Select all

In the mean time, I think a workaround solution is perhaps to compare the window names rather than the window references directly.


Actually I'm using this method as solution. :rofl:

And I will try to update the tolua++ version if I have spare time.