File tree Expand file tree Collapse file tree 1 file changed +13
-15
lines changed
Shared/mods/deathmatch/logic/luadefs Expand file tree Collapse file tree 1 file changed +13
-15
lines changed Original file line number Diff line number Diff line change @@ -223,25 +223,23 @@ int CLuaXMLDefs::xmlLoadString(lua_State* luaVM)
223223 CScriptArgReader argStream (luaVM);
224224 argStream.ReadString (strXmlContent);
225225
226- if (!argStream.HasErrors ())
226+ if (argStream.HasErrors ())
227+ return luaL_error (luaVM, argStream.GetFullErrorMessage ());
228+
229+ // Grab our resource
230+ CLuaMain* pLuaMain = m_pLuaManager->GetVirtualMachine (luaVM);
231+ if (pLuaMain)
227232 {
228- // Grab our resource
229- CLuaMain* pLuaMain = m_pLuaManager->GetVirtualMachine (luaVM);
230- if (pLuaMain)
231- {
232- CXMLNode* rootNode = pLuaMain->ParseString (strXmlContent);
233+ CXMLNode* rootNode = pLuaMain->ParseString (strXmlContent);
233234
234- if (rootNode && rootNode->IsValid ())
235- {
236- lua_pushxmlnode (luaVM, rootNode);
237- return 1 ;
238- }
239- else
240- m_pScriptDebugging->LogCustom (luaVM, " Unable to load XML string" );
235+ if (rootNode && rootNode->IsValid ())
236+ {
237+ lua_pushxmlnode (luaVM, rootNode);
238+ return 1 ;
241239 }
240+ else
241+ m_pScriptDebugging->LogCustom (luaVM, " Unable to load XML string" );
242242 }
243- else
244- return luaL_error (luaVM, argStream.GetFullErrorMessage ());
245243
246244 lua_pushboolean (luaVM, false );
247245 return 1 ;
You can’t perform that action at this time.
0 commit comments