diff --git a/src/game/editor/mapitems/map_io.cpp b/src/game/editor/mapitems/map_io.cpp index 092431d2b..31c95e0c7 100644 --- a/src/game/editor/mapitems/map_io.cpp +++ b/src/game/editor/mapitems/map_io.cpp @@ -549,7 +549,6 @@ bool CEditorMap::Load(const char *pFileName, int StorageType, const std::functio // copy base info std::shared_ptr pSound = std::make_shared(m_pEditor); - if(pItem->m_External) { char aBuf[IO_MAX_PATH_LENGTH]; diff --git a/src/game/editor/mapitems/sound.cpp b/src/game/editor/mapitems/sound.cpp index cdf7e025e..6465f915b 100644 --- a/src/game/editor/mapitems/sound.cpp +++ b/src/game/editor/mapitems/sound.cpp @@ -2,11 +2,14 @@ #include -#include +CEditorSound::CEditorSound(CEditor *pEditor) +{ + Init(pEditor); +} CEditorSound::~CEditorSound() { - m_pEditor->Sound()->UnloadSample(m_SoundID); + Sound()->UnloadSample(m_SoundID); free(m_pData); m_pData = nullptr; } diff --git a/src/game/editor/mapitems/sound.h b/src/game/editor/mapitems/sound.h index 6d3b00ed3..681f9ad30 100644 --- a/src/game/editor/mapitems/sound.h +++ b/src/game/editor/mapitems/sound.h @@ -3,30 +3,19 @@ #include -class CEditor; +#include -class CEditorSound +class CEditorSound : public CEditorComponent { public: - CEditor *m_pEditor; - - CEditorSound(CEditor *pEditor) - { - m_pEditor = pEditor; - m_aName[0] = 0; - m_SoundID = 0; - - m_pData = nullptr; - m_DataSize = 0; - } - + explicit CEditorSound(CEditor *pEditor); ~CEditorSound(); - int m_SoundID; - char m_aName[IO_MAX_PATH_LENGTH]; + int m_SoundID = 0; + char m_aName[IO_MAX_PATH_LENGTH] = ""; - void *m_pData; - unsigned m_DataSize; + void *m_pData = nullptr; + unsigned m_DataSize = 0; }; #endif