From 58bd8dcbb6dce82fd0b53378b33be919e6266533 Mon Sep 17 00:00:00 2001 From: Jupeyy Date: Sat, 10 Oct 2020 12:12:04 +0200 Subject: [PATCH] Fix virtual call in Constructor --- src/game/client/components/background.cpp | 5 +++-- src/game/client/components/menu_background.cpp | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/game/client/components/background.cpp b/src/game/client/components/background.cpp index 8a894eee3..cdac777d6 100644 --- a/src/game/client/components/background.cpp +++ b/src/game/client/components/background.cpp @@ -17,8 +17,6 @@ CBackground::CBackground(int MapType, bool OnlineOnly) : m_pBackgroundLayers = m_pLayers; m_pImages = new CMapImages; m_pBackgroundImages = m_pImages; - m_pBackgroundMap = CreateBGMap(); - m_pMap = m_pBackgroundMap; m_Loaded = false; m_aMapName[0] = '\0'; m_LastLoad = 0; @@ -37,6 +35,9 @@ CBackgroundEngineMap *CBackground::CreateBGMap() void CBackground::OnInit() { + m_pBackgroundMap = CreateBGMap(); + m_pMap = m_pBackgroundMap; + m_pImages->m_pClient = GameClient(); Kernel()->RegisterInterface(m_pBackgroundMap); if(g_Config.m_ClBackgroundEntities[0] != '\0' && str_comp(g_Config.m_ClBackgroundEntities, CURRENT_MAP)) diff --git a/src/game/client/components/menu_background.cpp b/src/game/client/components/menu_background.cpp index d1725ed14..9ecbed995 100644 --- a/src/game/client/components/menu_background.cpp +++ b/src/game/client/components/menu_background.cpp @@ -36,6 +36,9 @@ CBackgroundEngineMap *CMenuBackground::CreateBGMap() void CMenuBackground::OnInit() { + m_pBackgroundMap = CreateBGMap(); + m_pMap = m_pBackgroundMap; + m_IsInit = true; m_pImages->m_pClient = GameClient();