]> git.tdb.fi Git - libs/game.git/blobdiff - source/game/eventsource.h
Add unit tests for the event bus
[libs/game.git] / source / game / eventsource.h
index ccb830fb9fb3d4da7c91b265e6002285d9b1d937..1748f156f16588629b410dc030ac9326026ad487 100644 (file)
@@ -29,7 +29,7 @@ public:
 
        template<typename T>
        void add_observer(EventObserver &obs, std::function<void(const T &)> cb)
-       { static_cast<EventDispatcher<T> &>(*this).add_observer(obs, std::move(cb)); }
+       { static_cast<EventDispatcher<T> &>(*this).add_observer(&obs, std::move(cb)); }
 
        void remove_observer(EventObserver &obs) override
        { (static_cast<EventDispatcher<E> &>(*this).remove_observer(&obs), ...); }