mechanicmarx / gamekit

Automatically exported from code.google.com/p/gamekit
0 stars 0 forks source link

Messages to specify object do not work #192

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. create two cubes(names A,B) with message-sensor with subject "doit" and a 
motion actuator that moves the cubes
2. create e.g. keyboard-sensor with message-actuator that sends message 'doit' 
to A
3. both cubes will react

I fixed this by enhancing the GenericMessageListener in gkMessageManager. That 
has already the ability to filter specific to-Messages but once you set a 
to-filter it doesn't accept the empty-message that is meant to be handled by 
all messages that listen to that subject. 
I added two methods:
        void setAcceptEmptyTo(bool accept){this->m_acceptEmptyTo=accept;}
        bool isAcceptingEmptyTo(){return this->m_acceptEmptyTo;}

The constructor sets the acceptEmptyTo to false to the behviour of the 
GenericMessageListener doesn't changed unless you activate the 
empty-message-handling with lister->setAcceptEmptyTo(true)

The example-blend file also shows usage of a new lua-based message.

Original issue reported on code.google.com by thomas.t...@googlemail.com on 24 Oct 2011 at 1:11

Attachments:

GoogleCodeExporter commented 8 years ago
The patch is applied to trunk.
Thanks for the patch.

Original comment by harkon...@gmail.com on 25 Oct 2011 at 2:32