@@ -61,7 +61,7 @@ bool CLuaVectorGraphicDefs::SetDocument(CClientVectorGraphic* pVectorGraphic, CX
6161 if (!pVectorGraphic || !pXMLNode || !pXMLNode->IsValid ())
6262 return false ;
6363
64- pVectorGraphic->SetDocument (pXMLNode);
64+ return pVectorGraphic->SetDocument (pXMLNode);
6565}
6666
6767bool CLuaVectorGraphicDefs::LoadFromFile (lua_State* luaVM, CClientVectorGraphic* pVectorGraphic, CScriptFile* pFile, std::string strPath,
@@ -94,6 +94,8 @@ bool CLuaVectorGraphicDefs::LoadFromFile(lua_State* luaVM, CClientVectorGraphic*
9494 return false ;
9595 }
9696 }
97+
98+ return true ;
9799}
98100
99101bool CLuaVectorGraphicDefs::SetSize (CClientVectorGraphic* pVectorGraphic, CVector2D size)
@@ -276,16 +278,14 @@ CLuaMultiReturn<int, int> CLuaVectorGraphicDefs::SVGGetSize(CClientVectorGraphic
276278 return {(int )pVectorGraphic->GetRenderItem ()->m_uiSizeX , (int )pVectorGraphic->GetRenderItem ()->m_uiSizeY };
277279}
278280
279- bool CLuaVectorGraphicDefs::SVGSetSize (CClientVectorGraphic* pVectorGraphic, int width, int height , std::optional<CLuaFunctionRef> luaFunctionRef)
281+ bool CLuaVectorGraphicDefs::SVGSetSize (CClientVectorGraphic* pVectorGraphic, CVector2D size , std::optional<CLuaFunctionRef> luaFunctionRef)
280282{
281- if (width <= 0 || height <= 0 )
283+ if (size. fX <= 0 || size. fY <= 0 )
282284 throw std::invalid_argument (" A vector graphic must be atleast 1x1 in size." );
283285
284- if (width > 4096 || height > 4096 )
286+ if (size. fX > 4096 || size. fY > 4096 )
285287 throw std::invalid_argument (" A vector graphic cannot exceed 4096x4096 in size." );
286288
287- CVector2D size = CVector2D (width, height);
288-
289289 if (luaFunctionRef.has_value () && VERIFY_FUNCTION (luaFunctionRef.value ()))
290290 {
291291 CLuaFunctionRef funcRef = luaFunctionRef.value ();
0 commit comments