hedgewars/uScript.pas
branchspacecampaign
changeset 9642 8a691e0f117a
parent 9291 15f7bb217b66
child 9646 7588daa8d28f
--- a/hedgewars/uScript.pas	Thu Sep 19 02:33:23 2013 +0300
+++ b/hedgewars/uScript.pas	Thu Sep 19 03:49:29 2013 +0300
@@ -1291,7 +1291,7 @@
 var i : LongInt;
 var color : shortstring;
 begin
-	statInfo := TStatInfoType(GetEnumValue(TypeInfo(TStatInfoType),lua_tostring(L, 1)));
+	statInfo := TStatInfoType(lua_tointeger(L, 1));
 	if (lua_gettop(L) <> 2) and ((statInfo <> siPlayerKills) 
 			and (statInfo <> siClanHealth)) then
         begin
@@ -2299,6 +2299,7 @@
 var at : TGearType;
     vgt: TVisualGearType;
     am : TAmmoType;
+    si : TStatInfoType;
     st : TSound;
     he : THogEffect;
     cg : TCapGroup;
@@ -2381,6 +2382,9 @@
 for am:= Low(TAmmoType) to High(TAmmoType) do
     ScriptSetInteger(EnumToStr(am), ord(am));
 
+for si:= Low(TStatInfoType) to High(TStatInfoType) do
+    ScriptSetInteger(EnumToStr(si), ord(si));
+
 for he:= Low(THogEffect) to High(THogEffect) do
     ScriptSetInteger(EnumToStr(he), ord(he));