diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaVectorGraphicDefs.cpp b/Client/mods/deathmatch/logic/luadefs/CLuaVectorGraphicDefs.cpp index eba1e21d0c..34ed6d03fd 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaVectorGraphicDefs.cpp +++ b/Client/mods/deathmatch/logic/luadefs/CLuaVectorGraphicDefs.cpp @@ -110,7 +110,7 @@ bool CLuaVectorGraphicDefs::SetSize(CClientVectorGraphic* vectorGraphic, CVector int intSizeX = static_cast(size.fX); int intSizeY = static_cast(size.fY); - vectorGraphicItem->Resize(CVector2D(intSizeX, intSizeY)); + vectorGraphicItem->Resize(CVector2D(static_cast(intSizeX), static_cast(intSizeY))); vectorGraphic->GetDisplay()->Update(); return true; @@ -156,7 +156,7 @@ CClientVectorGraphic* CLuaVectorGraphicDefs::SVGCreate(lua_State* luaVM, CVector if (!didLoad) { - delete vectorGraphic; + g_pClientGame->GetManager()->GetRenderElementManager()->Remove(vectorGraphic); return nullptr; } } @@ -182,13 +182,13 @@ CClientVectorGraphic* CLuaVectorGraphicDefs::SVGCreate(lua_State* luaVM, CVector if (!didLoad) { - delete vectorGraphic; + g_pClientGame->GetManager()->GetRenderElementManager()->Remove(vectorGraphic); return nullptr; } } else { - delete vectorGraphic; + g_pClientGame->GetManager()->GetRenderElementManager()->Remove(vectorGraphic); m_pScriptDebugging->LogCustom(luaVM, SString("Unable to load SVG (invalid file path) [%s]", pathOrRawData.value().c_str())); return nullptr;