浏览代码

[qsrc2tw] Don't initialize variables if they are initialized already

Stephan Fuchs 3 月之前
父节点
当前提交
4f9117b102
共有 1 个文件被更改,包括 9 次插入7 次删除
  1. 9 7
      qsrc2tw/twine-code/stat_sklattrib.tw

+ 9 - 7
qsrc2tw/twine-code/stat_sklattrib.tw

@@ -1,9 +1,11 @@
 :: stat_sklattrib
-<<for _skillId, _skillDefinition range setup.skills>>
-	<<run $PC.skills[_skillId].levelInitialize(QSP["pcs_"+_skillId][0])>>
-<</for>>
+<<if QSP['attsklupdate'][0] != 1>>
+	<<for _skillId, _skillDefinition range setup.skills>>
+		<<run $PC.skills[_skillId].levelInitialize(QSP["pcs_"+_skillId][0])>>
+	<</for>>
 
-<<for _attributeId range setup.attributes>>
-	<<run $PC.attributes[_attributeId].levelInitialize(QSP["pcs_"+_attributeId][0])>>
-<</for>>
-<<set QSP['attsklupdate'][0] = 1>>
+	<<for _attributeId range setup.attributes>>
+		<<run $PC.attributes[_attributeId].levelInitialize(QSP["pcs_"+_attributeId][0])>>
+	<</for>>
+	<<set QSP['attsklupdate'][0] = 1>>
+<</if>>