Closed wrightmat closed 7 years ago
I think this is not an engine bug: If you are defining that event for the custom entity in the map script, then you are overriding the one defined in the custom entity script (only for that instance). This is just how Lua works, so nothing to do with Solarus.
If you want to execute only the one in the custom entity script, then do not re-define it in the map script again (check if it is already defined). If you want to use both, which is also possible, just use the multi events script made by @christopho.
I'm okay with this explanation and solution. If @christopho agrees, he can close the issue :)
If a custom entity has an on_interaction function defined, but that particular instance of the entity (say an NPC) also has on_interaction defined in the map script, the custom entity function never executes - only the map one does. Not sure if this is the intended behavior, but I would really like the custom entity one to run. If only one can execute, the custom entity function should be preferred, as the map function could easily be run from here if it exists.