Events are broken?

Hello everyone,

The documentation on Events (Found here: event documentation) says that they cannot be broadcasted out of events that do not own them. This is what is expected of events. For example, this is exactly how events in C# behave.

I have the following setup:

DECLARE_EVENT(ABaseCharacter, FDeathEvent)
DECLARE_EVENT(ABaseCharacter, FFireWeaponEvent)
DECLARE_EVENT(ABaseCharacter, FReloadWeaponEvent)

UCLASS(Abstract)
class THIRDPERSONSHOOTER_API ABaseCharacter : public ACharacter
{
public:
    FDeathEvent DeathEvent;
	FFireWeaponEvent FireWeaponEvent;
	FReloadWeaponEvent ReloadWeaponEvent;
...
}

These events shouldn’t be able to be broadcasted from other classes and the documentation says so. However, I have another class Weapon. The Weapon has a Weapon::User property which points to the User of the Weapon. Nothing stops me from writing:

Weapon* weapon;
weapon->User->FireWeaponEvent.Broadcast();

For me, this is not correct. In fact, I have this in my code and it compiles and runs without a problem. In a sense, the event acts as a simple delegate and in concept, the event is something more than a delegate. Should this be considered a bug in the UE4 C++ Event implementation? In C# this won’t compile.

Best regards.

EDIT: In my case the DECLARE_EVENT macro expands to:

class FDeathEvent : public TBaseMulticastDelegate<void>
{
        friend class ABaseCharacter;
};

Howeever, the TBaseMulticastDelegate::Broadcast() method seems to be public and in my opinion it should be private/protected.

Turns out I was right and it’s a bug that’s already backlogged:

https://issues.unrealengine.com/issue/UE-67922