Răsfoiți Sursa

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

Stephan Fuchs 3 luni în urmă
părinte
comite
4f9117b102
1 a modificat fișierele cu 9 adăugiri și 7 ștergeri
  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>>