hedgewars/uScript.pas
changeset 9648 3a3defce1b28
parent 9567 42bc1b58a242
parent 9646 7588daa8d28f
child 9656 18422d205080
--- a/hedgewars/uScript.pas	Sun Oct 27 22:34:25 2013 -0400
+++ b/hedgewars/uScript.pas	Mon Oct 28 14:07:04 2013 +0100
@@ -1292,7 +1292,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
@@ -2316,6 +2316,7 @@
 var at : TGearType;
     vgt: TVisualGearType;
     am : TAmmoType;
+    si : TStatInfoType;
     st : TSound;
     he : THogEffect;
     cg : TCapGroup;
@@ -2399,6 +2400,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));