Fix disaster in talents
This commit is contained in:
@@ -87,6 +87,32 @@
|
||||
files:
|
||||
- "**/*.xml"
|
||||
|
||||
- name: talenttrees
|
||||
regex: (<TalentOptions!any>!any</TalentOptions>)
|
||||
lua: |
|
||||
local talentOptions = 0
|
||||
local lines = strsplit(s1, "\n")
|
||||
for i, line in pairs(lines) do
|
||||
if string.find(line, "<TalentOption ") then
|
||||
talentOptions = talentOptions + 1
|
||||
end
|
||||
end
|
||||
|
||||
if lines[1]:find("maxchosentalents") then
|
||||
print("maxchosentalents found, updating")
|
||||
local optionsElement = lines[1]
|
||||
optionsElement = optionsElement:gsub("maxchosentalents=\"%d+\"", "maxchosentalents=\"" .. talentOptions .. "\"")
|
||||
replacement = s1:gsub(lines[1], optionsElement)
|
||||
return false
|
||||
end
|
||||
|
||||
print("maxchosentalents not found, creating")
|
||||
local optionsElement = lines[1]
|
||||
local optionsElement = optionsElement:gsub("<TalentOptions", "<TalentOptions maxchosentalents=\"" .. talentOptions .. "\"")
|
||||
replacement = s1:gsub(lines[1], optionsElement)
|
||||
files:
|
||||
- "**/TalentTrees.xml"
|
||||
|
||||
- name: alltalents
|
||||
regex: <TalentTrees>(!any)</TalentTrees>
|
||||
lua: |
|
||||
@@ -136,29 +162,3 @@
|
||||
s1 = table.concat(alltalents, "\n")
|
||||
files:
|
||||
- "Content/**/TalentTrees.xml"
|
||||
|
||||
- name: talenttrees
|
||||
regex: (<TalentOptions!any>!any</TalentOptions>)
|
||||
lua: |
|
||||
local talentOptions = 0
|
||||
local lines = strsplit(s1, "\n")
|
||||
for i, line in pairs(lines) do
|
||||
if string.find(line, "<TalentOption ") then
|
||||
talentOptions = talentOptions + 1
|
||||
end
|
||||
end
|
||||
|
||||
if lines[1]:find("maxchosentalents") then
|
||||
print("maxchosentalents found, updating")
|
||||
local optionsElement = lines[1]
|
||||
optionsElement = optionsElement:gsub("maxchosentalents=\"%d+\"", "maxchosentalents=\"" .. talentOptions .. "\"")
|
||||
replacement = s1:gsub(lines[1], optionsElement)
|
||||
return false
|
||||
end
|
||||
|
||||
print("maxchosentalents not found, creating")
|
||||
local optionsElement = lines[1]
|
||||
local optionsElement = optionsElement:gsub("<TalentOptions", "<TalentOptions maxchosentalents=\"" .. talentOptions .. "\"")
|
||||
replacement = s1:gsub(lines[1], optionsElement)
|
||||
files:
|
||||
- "**/TalentTrees.xml"
|
||||
|
||||
Reference in New Issue
Block a user