Skip to content

Commit

Permalink
safer xml parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ChronoVortex committed Jul 6, 2023
1 parent 49c3bbe commit 476f9fe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion data/vertex_module/particlesInit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ local animationFiles = {
}
for _, file in ipairs(animationFiles) do
local doc = RapidXML.xml_document(file)
for node in Children(doc:first_node("FTL")) do
for node in Children(doc:first_node("FTL") or doc) do
if node:name() == "particleType" then
particleTypes:ParseNew(node)
elseif node:name() == "particleEmitter" then
Expand Down
3 changes: 1 addition & 2 deletions data/vertex_module/xmlDataRead.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ local blueprintFiles = {
-- Parse custom tags in blueprints and save them to tables
for _, file in ipairs(blueprintFiles) do
local doc = RapidXML.xml_document(file)
local parent = doc:first_node("FTL")
for node in Children(parent) do
for node in Children(doc:first_node("FTL") or doc) do
if node:name() == "weaponBlueprint" then
local thisWeaponInfo = {}
local thisWeaponName = node:first_attribute("name"):value()
Expand Down
2 changes: 1 addition & 1 deletion mod-appendix/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<title><![CDATA[ Vertex Tags and Utility Functions ]]></title>
<threadUrl><![CDATA[ https://github.com/ChronoVortex/FTL-HS-Vertex ]]></threadUrl>
<author><![CDATA[ Vertaalfout, Chrono Vortex ]]></author>
<version><![CDATA[ 3.2 ]]></version>
<version><![CDATA[ 3.3 ]]></version>
<description>
<![CDATA[
This mod has no content, instead adding new tags and LUA utility functions for other mods to build off of.
Expand Down

0 comments on commit 476f9fe

Please sign in to comment.