Parcourir la source

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

Stephan Fuchs il y a 3 mois
Parent
commit
4f9117b102
1 fichiers modifiés avec 9 ajouts et 7 suppressions
  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>>