[fixed] SGUIEvent Bug

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
aanderse
Posts: 155
Joined: Sun Aug 10, 2008 2:02 pm
Location: Canada

[fixed] SGUIEvent Bug

Post by aanderse »

There is a bug with the SGUIEvent which you can see in CGUIEnvironment.cpp line 456 through 464 of Irrlicht version 1.7.1 as seen below:

Code: Select all

			SEvent event;
			event.EventType = EET_GUI_EVENT;

			if (lastHovered)
			{
				event.GUIEvent.Caller = lastHovered;
				event.GUIEvent.EventType = EGET_ELEMENT_LEFT;
				lastHovered->OnEvent(event);
			}
You'll notice event.GUIEvent.Element is never set to NULL.
If I am receiving gui events and a try to use the Element variable I can't determine if it is valid or not...

I guess this struct can't have a constructor because it is in a union... so I'm not sure what should be done?

Thank you.
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

I believe this is http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=38669
Last time when i checked, it was fixed in 1.7.1, but not merged with trunk.

P.S.: if you use Irrlicht Lime, see implementation of Event::GUI::get() in Event.cpp, to see how i temporary fixed it. I will remove that code when this fix will be in trunk.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Yeah. as greenya said :-)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
aanderse
Posts: 155
Joined: Sun Aug 10, 2008 2:02 pm
Location: Canada

Post by aanderse »

fantastic!

sorry or the false alarm...
thanks for your replies and help! :D
Post Reply