hedgewars/uScript.pas
changeset 5120 c4d5ddf939fc
parent 5118 9cfdb9bc6140
child 5124 84267f79879b
equal deleted inserted replaced
5119:f475e10c4081 5120:c4d5ddf939fc
  1557     vgt: TVisualGearType;
  1557     vgt: TVisualGearType;
  1558     am : TAmmoType;
  1558     am : TAmmoType;
  1559     st : TSound;
  1559     st : TSound;
  1560     he : THogEffect;
  1560     he : THogEffect;
  1561     cg : TCapGroup;
  1561     cg : TCapGroup;
  1562     s, t : ansistring;
       
  1563 begin
  1562 begin
  1564 // initialize lua
  1563 // initialize lua
  1565 luaState:= lua_open;
  1564 luaState:= lua_open;
  1566 TryDo(luaState <> nil, 'lua_open failed', true);
  1565 TryDo(luaState <> nil, 'lua_open failed', true);
  1567 
  1566 
  1573 
  1572 
  1574 // import some variables
  1573 // import some variables
  1575 ScriptSetInteger('LAND_WIDTH', LAND_WIDTH);
  1574 ScriptSetInteger('LAND_WIDTH', LAND_WIDTH);
  1576 ScriptSetInteger('LAND_HEIGHT', LAND_HEIGHT);
  1575 ScriptSetInteger('LAND_HEIGHT', LAND_HEIGHT);
  1577 
  1576 
  1578 // import locale
  1577 ScriptSetString('L', cLocale);
  1579 s:= cLocaleFName;
       
  1580 t:= '';
       
  1581 SplitByChar(s, t, '.');
       
  1582 ScriptSetString('L', s);
       
  1583 
  1578 
  1584 // import game flags
  1579 // import game flags
  1585 ScriptSetInteger('gfForts', gfForts);
  1580 ScriptSetInteger('gfForts', gfForts);
  1586 ScriptSetInteger('gfMultiWeapon', gfMultiWeapon);
  1581 ScriptSetInteger('gfMultiWeapon', gfMultiWeapon);
  1587 ScriptSetInteger('gfSolidLand', gfSolidLand);
  1582 ScriptSetInteger('gfSolidLand', gfSolidLand);