Ver Fonte

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

Stephan Fuchs há 3 meses atrás
pai
commit
4f9117b102
1 ficheiros alterados com 9 adições e 7 exclusões
  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>>