From 5f7a09dfe34a0edb7192786e9ebe3aa0805c6435 Mon Sep 17 00:00:00 2001 From: 12pm <30786226+12pm@users.noreply.github.com> Date: Wed, 17 Jul 2019 03:00:09 +0200 Subject: [PATCH] Correctly embed replacing images --- src/game/editor/editor.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index 893668a44..f64737dfa 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -3481,7 +3481,6 @@ void CEditor::ReplaceImage(const char *pFileName, int StorageType, void *pUser) return; CEditorImage *pImg = pEditor->m_Map.m_lImages[pEditor->m_SelectedImage]; - int External = pImg->m_External; pEditor->Graphics()->UnloadTexture(pImg->m_TexID); if(pImg->m_pData) { @@ -3489,8 +3488,8 @@ void CEditor::ReplaceImage(const char *pFileName, int StorageType, void *pUser) pImg->m_pData = 0; } *pImg = ImgInfo; - pImg->m_External = External; IStorage::StripPathAndExtension(pFileName, pImg->m_aName, sizeof(pImg->m_aName)); + pImg->m_External = IsVanillaImage(pImg->m_aName); pImg->m_AutoMapper.Load(pImg->m_aName); pImg->m_TexID = pEditor->Graphics()->LoadTextureRaw(ImgInfo.m_Width, ImgInfo.m_Height, ImgInfo.m_Format, ImgInfo.m_pData, CImageInfo::FORMAT_AUTO, 0); ImgInfo.m_pData = 0;