equal
deleted
inserted
replaced
1289 function lc_sendstat(L : Plua_State) : LongInt; Cdecl; |
1289 function lc_sendstat(L : Plua_State) : LongInt; Cdecl; |
1290 var statInfo : TStatInfoType; |
1290 var statInfo : TStatInfoType; |
1291 var i : LongInt; |
1291 var i : LongInt; |
1292 var color : shortstring; |
1292 var color : shortstring; |
1293 begin |
1293 begin |
1294 statInfo := TStatInfoType(GetEnumValue(TypeInfo(TStatInfoType),lua_tostring(L, 1))); |
1294 statInfo := TStatInfoType(lua_tointeger(L, 1)); |
1295 if (lua_gettop(L) <> 2) and ((statInfo <> siPlayerKills) |
1295 if (lua_gettop(L) <> 2) and ((statInfo <> siPlayerKills) |
1296 and (statInfo <> siClanHealth)) then |
1296 and (statInfo <> siClanHealth)) then |
1297 begin |
1297 begin |
1298 LuaError('Lua: Wrong number of parameters passed to SendStat! Expected 2 parameters.'); |
1298 LuaError('Lua: Wrong number of parameters passed to SendStat! Expected 2 parameters.'); |
1299 end |
1299 end |
2297 |
2297 |
2298 procedure initModule; |
2298 procedure initModule; |
2299 var at : TGearType; |
2299 var at : TGearType; |
2300 vgt: TVisualGearType; |
2300 vgt: TVisualGearType; |
2301 am : TAmmoType; |
2301 am : TAmmoType; |
|
2302 si : TStatInfoType; |
2302 st : TSound; |
2303 st : TSound; |
2303 he : THogEffect; |
2304 he : THogEffect; |
2304 cg : TCapGroup; |
2305 cg : TCapGroup; |
2305 begin |
2306 begin |
2306 // initialize lua |
2307 // initialize lua |
2378 ScriptSetInteger(EnumToStr(st), ord(st)); |
2379 ScriptSetInteger(EnumToStr(st), ord(st)); |
2379 |
2380 |
2380 // register ammo types |
2381 // register ammo types |
2381 for am:= Low(TAmmoType) to High(TAmmoType) do |
2382 for am:= Low(TAmmoType) to High(TAmmoType) do |
2382 ScriptSetInteger(EnumToStr(am), ord(am)); |
2383 ScriptSetInteger(EnumToStr(am), ord(am)); |
|
2384 |
|
2385 for si:= Low(TStatInfoType) to High(TStatInfoType) do |
|
2386 ScriptSetInteger(EnumToStr(si), ord(si)); |
2383 |
2387 |
2384 for he:= Low(THogEffect) to High(THogEffect) do |
2388 for he:= Low(THogEffect) to High(THogEffect) do |
2385 ScriptSetInteger(EnumToStr(he), ord(he)); |
2389 ScriptSetInteger(EnumToStr(he), ord(he)); |
2386 |
2390 |
2387 for cg:= Low(TCapGroup) to High(TCapGroup) do |
2391 for cg:= Low(TCapGroup) to High(TCapGroup) do |