From: Mikko Rasa Date: Thu, 8 Jun 2023 08:21:08 +0000 (+0300) Subject: Place Networking after event things in Director X-Git-Url: https://git.tdb.fi/?a=commitdiff_plain;h=26eac0b33093d248c97f0f140ea9d1153bf814f7;p=libs%2Fgame.git Place Networking after event things in Director It uses the event bus, so correct order of destruction must be ensured. --- diff --git a/source/game/director.cpp b/source/game/director.cpp index ef906c3..d42daa8 100644 --- a/source/game/director.cpp +++ b/source/game/director.cpp @@ -12,8 +12,8 @@ namespace Msp::Game { Director::Director(DataFile::Collection &r): resources(r), - networking(*this), - event_source(event_bus) + event_source(event_bus), + networking(*this) { #if DEBUG access_guard.emplace(); diff --git a/source/game/director.h b/source/game/director.h index dc6e483..8037788 100644 --- a/source/game/director.h +++ b/source/game/director.h @@ -30,9 +30,9 @@ private: Reflection::Reflector reflector; DataFile::Collection &resources; IO::EventDispatcher io_dispatcher; - Networking networking; EventBus event_bus; EventSource event_source; + Networking networking; std::vector> stages; Stage *active_stage = nullptr; Time::TimeStamp last_tick;